Angular-cli: Installation problem - invalid packages names

Created on 17 Sep 2016  路  7Comments  路  Source: angular/angular-cli

  1. Mac OSX El Capitan
  2. Node 5.2.0, 6.0.0., 6.6.0
  3. I'm trying to install the latest version of angular-cli:

npm uninstall -g angular-cli
npm cache clean
npm install -g angular-cli@latest

  1. For node 5.2.0 (npm version 3.3.12) I get errors:
npm WARN install Couldn't install optional dependency: Invalid name: "@angular/tsc-wrapped"
npm WARN install Couldn't install optional dependency: Invalid name: "@angular-cli/base-href-webpack"
npm WARN install Couldn't install optional dependency: Invalid name: "@angular/platform-browser"
npm WARN install Couldn't install optional dependency: Invalid name: "@angular/platform-server"
npm WARN install Couldn't install optional dependency: Invalid name: "@angular/compiler"
npm WARN install Couldn't install optional dependency: Invalid name: "@angular-cli/ast-tools"
npm WARN install Couldn't install optional dependency: Invalid name: "@angular/compiler-cli"
npm WARN install Couldn't install optional dependency: Invalid name: "@angular/common"
npm WARN install Couldn't install optional dependency: Invalid name: "@angular/core"

For node 6.6.0

npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "angular-cli@latest"
npm ERR! node v6.6.0
npm ERR! npm  v3.10.3

npm ERR! Invalid name: "@angular/tsc-wrapped"

For node 6.0.0

(node:89154) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "angular-cli@latest"
npm ERR! node v6.0.0
npm ERR! npm  v3.8.6

npm ERR! Invalid name: "@angular-cli/base-href-webpack"
more info

Most helpful comment

Turns out, an update to npm fixed this issue on Mac OS X (El Capitan).

Here's how I resolved this issue:

  sudo npm update npm -g
  npm --v
  node -v
  sudo npm uninstall -g angular-cli
  sudo npm cache clean
  sudo npm install -g angular-cli@latest

After running the following commands, following were the versions of npm and node:

npm: 3.10.9
node: v6.6.0

All 7 comments

Possibly related https://github.com/angular/angular-cli/issues/2150

What is the result of running npm info @angular/core dist-tags?

I get the following error when I run sudo npm install -g @angular-cli@latest
Darwin 15.4.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "angular-cli@latest"
npm ERR! node v6.7.0
npm ERR! npm v3.10.3

npm ERR! Invalid name: "@angular-cli/ast-tools"

Following are the debug logs:
2911 verbose stack Error: Invalid name: "@angular-cli/ast-tools"
2911 verbose stack at ensureValidName (/usr/local/lib/node_modules/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/fixer.js:281:15)
2911 verbose stack at Object.fixNameField (/usr/local/lib/node_modules/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/fixer.js:196:5)
2911 verbose stack at /usr/local/lib/node_modules/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/normalize.js:29:38
2911 verbose stack at Array.forEach (native)
2911 verbose stack at normalize (/usr/local/lib/node_modules/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/normalize.js:28:15)
2911 verbose stack at final (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:349:5)
2911 verbose stack at then (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:124:5)
2911 verbose stack at /usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:214:31
2911 verbose stack at f (/usr/local/lib/node_modules/npm/node_modules/once/once.js:17:25)
2911 verbose stack at Glob. (/usr/local/lib/node_modules/npm/node_modules/read-package-json/node_modules/glob/glob.js:146:7)
2912 verbose cwd /Users/XXX
2913 error Darwin 15.4.0
2914 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "angular-cli@latest"
2915 error node v6.7.0
2916 error npm v3.10.3
2917 error Invalid name: "@angular-cli/ast-tools"

Following is the result after running

npm info @angular/core dist-tags

{ latest: '2.0.2', next: '2.1.0-rc.0' }

@filipesilva In my case:

$ npm info @angular/core dist-tags
{ latest: '2.0.2', next: '2.1.0-rc.0' }

Turns out, an update to npm fixed this issue on Mac OS X (El Capitan).

Here's how I resolved this issue:

  sudo npm update npm -g
  npm --v
  node -v
  sudo npm uninstall -g angular-cli
  sudo npm cache clean
  sudo npm install -g angular-cli@latest

After running the following commands, following were the versions of npm and node:

npm: 3.10.9
node: v6.6.0

@Olgagr you seem to have some npm problem. npm info shows the package exists, but npm install says the package name is invalid. @apatil88 seems to have fixed it by updating npm, so perhaps that works.

Either way there isn't anything we can do on the CLI itself, we have those dependencies and cannot do without them.

tks champions \o/

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rwillmer picture rwillmer  路  3Comments

daBishMan picture daBishMan  路  3Comments

JanStureNielsen picture JanStureNielsen  路  3Comments

ericel picture ericel  路  3Comments

rajjejosefsson picture rajjejosefsson  路  3Comments