npm uninstall -g angular-cli
npm cache clean
npm install -g angular-cli@latest
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"
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.
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._
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:
After running the following commands, following were the versions of npm and node:
npm: 3.10.9
node: v6.6.0