NPM won't install angular2

I'm trying to get started with Angular 2 and for some reason npm won't load it. I ran the npm update command several times, so this is not an issue with npm.

I keep getting the following error:

error notarget No compatible version found: angular2@'*'
36 error notarget Valid install targets:
36 error notarget ["2.0.0-alpha.8.dev","2.0.0-alpha.8.prod","2.0.0-alpha.11","2.0.0-alpha.12","2.0.0-alpha.13","2.0.0-alpha.14","2.0.0-alpha.15","2.0.0-alpha.16","2.0.0-alpha.17","2.0.0-alpha.18","2.0.0-alpha.19","2.0.0-alpha.20","2.0.0-alpha.21","2.0.0-alpha.22","2.0.0-alpha.23","2.0.0-alpha.24","2.0.0-alpha.25","2.0.0-alpha.26","2.0.0-alpha.27","2.0.0-alpha.28","2.0.0-alpha.29","2.0.0-alpha.30","2.0.0-alpha.31","2.0.0-alpha.32"]
36 error notarget

      

It's such a funny road block trying to learn how to wireframe.

Does anyone know how to fix this or is there a download source that actually works? I just want to start with Angular2 = (

+3


source to share


4 answers


Use the following line as requested:

npm install angular2@2.0.0-alpha.32

      



Note that the error message gave the key. As shown below, the error message tried to tell you what is really after angular2@

. 2.0.0-alpha.32

is currently the latest version.

Valid install targets:
["2.0.0-alpha.8.dev","2.0.0-alpha.8.prod","2.0.0-alpha.11","2.0.0-alpha.12","2.0.0-alpha.13","2.0.0-alpha.14","2.0.0-alpha.15","2.0.0-alpha.16","2.0.0-alpha.17","2.0.0-alpha.18","2.0.0-alpha.19","2.0.0-alpha.20","2.0.0-alpha.21","2.0.0-alpha.22","2.0.0-alpha.23","2.0.0-alpha.24","2.0.0-alpha.25","2.0.0-alpha.26","2.0.0-alpha.27","2.0.0-alpha.28","2.0.0-alpha.29","2.0.0-alpha.30","2.0.0-alpha.31","2.0.0-alpha.32"]

      

+9


source


Try this:

npm install angular2 -g

      

This worked for me and installed angularJS2 alpha32. You can add the --save flag to preserve the module name in the existing .json package, if needed.



EDIT: the -g attribute will set angular2 globally, removing the -g will set it locally, which should be preferred!

Later, if possible, I would prefer to install angular2 in a different way, that is, with Bower:

bower install angular2

      

+2


source


What version of NPM are you using? Try updating it if tag providing doesn't work.

+1


source


I found that deleting my .npmrc file (in my user directory) fixed my problems while installing angular2 and reactivex / rxjs.

0


source







All Articles