Thursday, November 16, 2017

Invalid name: "@angular/cli" when do npm install


$sudo npm install -g @angular/cli

But I got the following error
npm ERR! Darwin 16.7.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "@angular/cli"
npm ERR! node v6.6.0
npm ERR! npm  v3.10.3

npm ERR! Invalid name: "@angular/cli"
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/jimz/Downloads/moxtra-admin/npm-debug.log
Somehow it looks weird as I configured angular/cli in package.json, but it result from npm version is outdated, so I did the npm update

$sudo npm update npm -g

Also the following commands can help check versions and do a clean install via "uninstall -> clean -> install".
$npm --v
$node -v
$sudo npm uninstall -g angular-cli
$sudo npm cache clean
$sudo npm install -g angular-cli@latest

 

No comments:

Post a Comment