Can't install angular-cli globally
Please provide us with the following information:
- OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
Mac OSX El Capitan
- Versions. Please run
ng --version. If there's nothing outputted, please run in a Terminal:node --versionand paste the result here:
latest
- Repro steps. Was this an app that wasn't created using the CLI? What change did you do on your code? etc.
npm install -g angular-cli or sudo npm install -g angular-cli or npm install -g angular-cli@latest
- The log given by the failure. Normally this include a stack trace and some more information.
canker:Angular CanKer$ sudo npm install -g angular-cli
npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: This package has been discontinued in favor of lodash@^4.0.0.
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130
/usr/local/bin/ng -> /usr/local/lib/node_modules/angular-cli/bin/ng
> [email protected] install /usr/local/lib/node_modules/angular-cli/node_modules/fsevents
> node-pre-gyp install --fallback-to-build
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
sh: node-pre-gyp: command not found
npm WARN install:[email protected] [email protected] install: `node-pre-gyp install --fallback-to-build`
npm WARN install:[email protected] spawn ENOENT
> [email protected] install /usr/local/lib/node_modules/angular-cli/node_modules/execSync
> node install.js
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
sh: node: command not found
/usr/local/lib
`-- (empty)
npm WARN [email protected] requires a peer of [email protected] || 2.x.x but none was installed.
npm ERR! Darwin 15.5.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! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! [email protected] install: `node install.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] install script 'node install.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the execSync package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs execSync
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls execSync
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/CanKer/Documents/Projekte/Angular/npm-debug.log
npm ERR! code 1
- Mention any other details that might be useful.
I'd installed not globally by error before and if I write npm view angular-cli version I see 1.0.0-beta.14 but I can't use the commands like ng new...
Thanks! We'll be in touch soon.
Try to clean cache npm cache clean, uninstall angular-cli npm uninstall -g angular-cli & install again npm install -g angular-cli
Sorry @neilhem that doesn't work. :(
+1. This doesn't work for me in Ubuntu 14.04 as well. Somehow ng serve still serves with old version (by checking the webpack its running).
To get my app working temporarily, I do.
- Clean uninstall of
angular-cli, likesudo npm uninstall -g angular-cli - Clone this
angular-clirepo, - Go to the
angular-clirepo folder, and runnpm link, - Go to my project folder
- Run
npm link angular-cli - Now to run
ngcommand, I use./node_modules/angular-cli/bin/ngfrom my project folder
Hello I just installed with -f or --force flag and it worked.
I should close this and thank you all for your time. :)
@CanKer Hello How where to use -force flag?
npm install -g -f angular-cli @karthikkavin
Thanks @CanKer
For me npm install -g -f angular-cli gives below error message could you please suggest fix for this.
npm WARN using --force I sure hope you know what you are doing. npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will n node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as p . Use 'npm ls graceful-fs' to find it in the tree. npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or to avoid a RegExp DoS issue npm WARN deprecated [email protected]: This package is discontinued. Use ^4.0.0. npm ERR! Windows_NT 6.1.7601 npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\shekharsu pData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "install" "-g" " gular-cli" npm ERR! node v4.5.0 npm ERR! npm v3.10.6 npm ERR! path C:\Users\SHEKHA~1\AppData\Local\Temp\npm-9268-e64aa74b\regi mjs.org\uc.micro npm ERR! code EPERM npm ERR! errno -4048 npm ERR! syscall mkdir
npm ERR! Error: EPERM: operation not permitted, mkdir 'C:\Users\SHEKHA~1
\Local\Temp\npm-9268-e64aa74b\registry.npmjs.org\uc.micro'
npm ERR! at Error (native)
npm ERR! { [Error: EPERM: operation not permitted, mkdir 'C:\Users\SHEKH
Data\Local\Temp\npm-9268-e64aa74b\registry.npmjs.org\uc.micro']
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'mkdir',
npm ERR! path: 'C:\Users\SHEKHA~1\AppData\Local\Temp\npm-9268-e64
registry.npmjs.org\uc.micro',
npm ERR! parent: 'markdown-it' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Please include the following file with any support request: npm ERR! D:\angular\npm-debug.log
@shekhar90 have you tried solution in this comment
yes... its not working for me
@neilhem The following worked for me npm cache clean npm uninstall -g angular-cli npm install -g -f angular-cli ng --help
Thats it.
npm WARN @angular/[email protected] requires a peer of @angular/[email protected] but none was installed. npm WARN @angular/[email protected] requires a peer of @angular/[email protected] but none was installed. npm WARN @angular/[email protected] requires a peer of @angular/[email protected] but none was installed. npm ERR! Darwin 15.6.0 npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "angular-cli" npm ERR! node v6.8.1 npm ERR! npm v3.10.8 npm ERR! path /lib npm ERR! code EACCES npm ERR! errno -13 npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/lib' npm ERR! at Error (native) npm ERR! { Error: EACCES: permission denied, access '/lib' npm ERR! at Error (native) errno: -13, code: 'EACCES', syscall: 'access', path: '/lib' } npm ERR! npm ERR! Please try running this command again as root/Administrator.
npm ERR! Please include the following file with any support request: npm ERR! /Users/deedaralam/npm-debug.log
Kindly solve this issue
Find the location of nodejs via where is nodejs then do,
ln -s /usr/bin/nodejs ~/bin/node (yes, no sudo there); replace /usr/bin/nodejs with the path your nodejs is at.
i have try now can you share your screenshots

kindly tell me step by step
This looks like you are having some other locking problem with your Mac Os.
Please check below link for your problem. http://apple.stackexchange.com/questions/101328/file-cant-be-moved-by-root-on-os-x
hi all i am getting this error while running the command ng new app1

i am getting this error while running ng serve...it is giving hot webpack dev server problem..any help me pls
