Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use AngularJS 2 without npm and Node.js?

Tags:

npm

angular

The current versions of AngularJS 2 references always npm based configurations.

  1. Is it possible to manage a project of AngularJS 2 without npm?
  2. Is it possible to use AngularJS 2 in production statically without npm/Node.js

I already found answers for examples using the beta versions of AngularJS 2 usiing links like https://code.angularjs.org/2.0.0-beta.17/angular2-all.umd.min.js. But for the current versions (like 2.1.1) there is no support left. Every examples and documentations point to npm (like https://angular.io/guide/quickstart).

like image 741
GreNodge Avatar asked Oct 27 '16 14:10

GreNodge


People also ask

Can I run Angular without NodeJS?

Building an Angular APP without node. js with npm or yarn is not possible. Typically you use the Angular CLI to setup a project and to compile it. And for this you need node, to "build", "develop", "compile or transpile" your angular app.

Can we run Angular without npm?

You can run an Angular app on any server that can host static files. There is nothing special about node. So yes, you can use a ruby.

Can we write Angular code without TypeScript?

Angular2 is available in TypeScript, JavaScript and Dart. No need to use TypeScript.

Is NodeJS and AngularJS same?

AngularJS is a client-side framework. Node. js is a cross-platform runtime environment. AngularJS supports two-way data binding but cannot support database query writing features.

What is the importance of Node JS and NPM in angular?

Node.js & npm is important for following reasons. Technically you can install and run angular code without node.js and npm. It does ease things though. Node.js is useful for project structuring, module management, dependency installation etc and you need to to do manually all this stuffs.

Is it possible to run angular code without Node JS?

Technically you can install and run angular code without node.js and npm. It does ease things though. Node.js is useful for project structuring, module management, dependency installation etc and you need to to do manually all this stuffs.

Is it possible to develop an app without using Node JS?

node.js is only used to manage the dependencies of an angular 2 application. If you can somehow manage to get those dependencies without using node.js, npm or jspm then you can run and develop your application offline.

Do I need node if I have NPM?

To answer your question, yes and no. npm is a package manager. Installing a package with npm is the same as copying the package and its dependencies to your local directory. So if you want the nice features that come with npm then you should install npm and you need node to do that.


2 Answers

I found after a long search this github Repository with a working example for my question 2.: https://github.com/mgechev/angular2-simple-build

like image 157
GreNodge Avatar answered Oct 13 '22 14:10

GreNodge


You need the node_modules folder in your project, which you get from npm or you could find online somewhere. I have ran projects without npm a few times, rather than using npm and the npm start command you can just run your code with whatever editor you are usings start commands.

like image 1
Bean0341 Avatar answered Oct 13 '22 14:10

Bean0341