Leon Gaban
Leon Gaban

Reputation: 39044

Error when using npm install angular2 --save

I'm following along in a Tuts+ tutorial on Angular. In this video: https://code.tutsplus.com/courses/whats-new-in-angular-2/lessons/angular-2-and-es5 the author says to type the following command:

npm install angular2 --save

I tried that, as well as using sudo in front of it as well, but get the following errors:

npm WARN package.json [email protected] No description
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No README data
npm ERR! Darwin 15.0.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "angular2" "--save"
npm ERR! node v0.12.7
npm ERR! npm  v2.11.3
npm ERR! code ETARGET

npm ERR! notarget No compatible version found: angular2@'*'
npm ERR! notarget Valid install targets:
npm ERR! 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","2.0.0-alpha.33","2.0.0-alpha.34","2.0.0-alpha.35","2.0.0-alpha.36","2.0.0-alpha.37","2.0.0-alpha.38","2.0.0-alpha.39","2.0.0-alpha.40","2.0.0-alpha.41","2.0.0-alpha.42","2.0.0-alpha.44","2.0.0-alpha.45","2.0.0-alpha.46","2.0.0-alpha.47","2.0.0-alpha.48","2.0.0-alpha.49","2.0.0-alpha.50","2.0.0-alpha.51","2.0.0-alpha.52","2.0.0-alpha.53","2.0.0-alpha.54","2.0.0-alpha.55","2.0.0-beta.0","2.0.0-beta.1"]
npm ERR! notarget
npm ERR! notarget This is most likely not a problem with npm itself.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

enter image description here

thoughts?

The author is able to do it fine without errors:

enter image description here

Upvotes: 1

Views: 1296

Answers (1)

Eric Martinez
Eric Martinez

Reputation: 31787

To install angular2 using npm you can either specify the version or use @latest

  • Specifying a version
npm install [email protected] --save
  • Using latest (this will obviously install the latest version available in npm)
npm install angular2@latest --save

Note as well that there are plans to support angular@next that would add the posibility to install nightly builds, but it's not yet supported (so far snapshots are released from time to time, but the command is not yet available). Check issue #4671 for more info.

Upvotes: 4

Related Questions