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.
Has anyone used yarn package manager. Its fast, easy, understandable (meaningful). You can :
- Install yarn
npm install yarn -g - use yarn to install angular-cli
yarn global add angular-cli.
Done thats its it worked for me.
In my case problem was related to this issue with ui.micro https://github.com/Microsoft/vscode/issues/13559 disable McAfee fix the problem.
Please try this before you will start installing angular-cli on your machine:
npm install -g uc.micro
Maybe it will help someone else.
Sooo ng doesn't run. I am not having a fun time with the CLI
Aymons-MacBook-Air:MyProjects aymon$ npm install -g -f angular-cli
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 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]: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130
npm WARN deprecated [email protected]: use uuid module instead
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
/Users/aymon/.npm-packages/bin/ng -> /Users/aymon/.npm-packages/lib/node_modules/angular-cli/bin/ng
/Users/aymon/.npm-packages/lib
└── [email protected]
Aymons-MacBook-Air:MyProjects aymon$ ng
-bash: ng: command not found
EDIT: had to add alias ng="/Users/aymon/.npm-packages/lib/node_modules/angular-cli/bin/ng" to ~/.bash_profile and i can use the command now
C:\Users\499705\Desktop\angular cli>npm install -g angular-cli@latest npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue C:\Users\499705\AppData\Roaming\npm\ng -> C:\Users\499705\AppData\Roaming\npm\no de_modules\angular-cli\bin\ng
[email protected] install C:\Users\499705\AppData\Roaming\npm\node_modules\angul ar-cli\node_modules\node-sass node scripts/install.js
Cached binary found at C:\Users\499705\AppData\Roaming\npm-cache\node-sass\4.5.0 \win32-ia32-48_binding.node
[email protected] postinstall C:\Users\499705\AppData\Roaming\npm\node_modules\a ngular-cli\node_modules\node-sass node scripts/build.js
Binary found at C:\Users\499705\AppData\Roaming\npm\node_modules\angular-cli\nod
e_modules\node-sass\vendor\win32-ia32-48\binding.node
Testing binary
Binary has a problem: Error: %1 is not a valid Win32 application.
\?\C:\Users\499705\AppData\Roaming\npm\node_modules\angular-cli\node_modules\no
de-sass\vendor\win32-ia32-48\binding.node
at Error (native)
at Object.Module._extensions..node (module.js:597:18)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at module.exports (C:\Users\499705\AppData\Roaming\npm\node_modules\angular-
cli\node_modules\node-sass\lib\binding.js:19:10)
at Object.which failed Error: not found: python2
gyp verb which failed at getNotFoundError (C:\Users\499705\AppData\Roaming
\npm\node_modules\angular-cli\node_modules\which\which.js:13:12)
gyp verb which failed at F (C:\Users\499705\AppData\Roaming\npm\node_modul
es\angular-cli\node_modules\which\which.js:68:19)
gyp verb which failed at E (C:\Users\499705\AppData\Roaming\npm\node_modul
es\angular-cli\node_modules\which\which.js:80:29)
gyp verb which failed at C:\Users\499705\AppData\Roaming\npm\node_modules
angular-cli\node_modules\which\which.js:89:16
gyp verb which failed at C:\Users\499705\AppData\Roaming\npm\node_modules
angular-cli\node_modules\isexe\index.js:44:5
gyp verb which failed at C:\Users\499705\AppData\Roaming\npm\node_modules
angular-cli\node_modules\isexe\windows.js:29:5
gyp verb which failed at FSReqWrap.oncomplete (fs.js:123:15)
gyp verb which failed python2 { Error: not found: python2
gyp verb which failed at getNotFoundError (C:\Users\499705\AppData\Roaming
\npm\node_modules\angular-cli\node_modules\which\which.js:13:12)
gyp verb which failed at F (C:\Users\499705\AppData\Roaming\npm\node_modul
es\angular-cli\node_modules\which\which.js:68:19)
gyp verb which failed at E (C:\Users\499705\AppData\Roaming\npm\node_modul
es\angular-cli\node_modules\which\which.js:80:29)
gyp verb which failed at C:\Users\499705\AppData\Roaming\npm\node_modules
angular-cli\node_modules\which\which.js:89:16
gyp verb which failed at C:\Users\499705\AppData\Roaming\npm\node_modules
angular-cli\node_modules\isexe\index.js:44:5
gyp verb which failed at C:\Users\499705\AppData\Roaming\npm\node_modules
angular-cli\node_modules\isexe\windows.js:29:5
gyp verb which failed at FSReqWrap.oncomplete (fs.js:123:15) code: 'ENOENT
' }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb which failed Error: not found: python
gyp verb which failed at getNotFoundError (C:\Users\499705\AppData\Roaming
\npm\node_modules\angular-cli\node_modules\which\which.js:13:12)
gyp verb which failed at F (C:\Users\499705\AppData\Roaming\npm\node_modul
es\angular-cli\node_modules\which\which.js:68:19)
gyp verb which failed at E (C:\Users\499705\AppData\Roaming\npm\node_modul
es\angular-cli\node_modules\which\which.js:80:29)
gyp verb which failed at C:\Users\499705\AppData\Roaming\npm\node_modules
angular-cli\node_modules\which\which.js:89:16
gyp verb which failed at C:\Users\499705\AppData\Roaming\npm\node_modules
angular-cli\node_modules\isexe\index.js:44:5
gyp verb which failed at C:\Users\499705\AppData\Roaming\npm\node_modules
angular-cli\node_modules\isexe\windows.js:29:5
gyp verb which failed at FSReqWrap.oncomplete (fs.js:123:15)
gyp verb which failed python { Error: not found: python
gyp verb which failed at getNotFoundError (C:\Users\499705\AppData\Roaming
\npm\node_modules\angular-cli\node_modules\which\which.js:13:12)
gyp verb which failed at F (C:\Users\499705\AppData\Roaming\npm\node_modul
es\angular-cli\node_modules\which\which.js:68:19)
gyp verb which failed at E (C:\Users\499705\AppData\Roaming\npm\node_modul
es\angular-cli\node_modules\which\which.js:80:29)
gyp verb which failed at C:\Users\499705\AppData\Roaming\npm\node_modules
angular-cli\node_modules\which\which.js:89:16
gyp verb which failed at C:\Users\499705\AppData\Roaming\npm\node_modules
angular-cli\node_modules\isexe\index.js:44:5
gyp verb which failed at C:\Users\499705\AppData\Roaming\npm\node_modules
angular-cli\node_modules\isexe\windows.js:29:5
gyp verb which failed at FSReqWrap.oncomplete (fs.js:123:15) code: 'ENOENT
' }
gyp verb could not find "python". checking python launcher
gyp verb could not find "python". guessing location
gyp verb ensuring that file exists: C:\Python27\python.exe
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYT
HON env variable.
gyp ERR! stack at Object.failNoPython (C:\Users\499705\AppData\Roaming\npm\n
ode_modules\angular-cli\node_modules\node-gyp\lib\configure.js:454:19)
gyp ERR! stack at Object.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\an
gular-cli\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@
1.0.17: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"ia32
"})
npm WARN @angular/[email protected] requires a peer of rxjs@^5.0.1 but none was install
ed.
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\499705\AppData
\Roaming\npm\node_modules\npm\bin\npm-cli.js" "install" "-g" "angular-cli@l
atest"
npm ERR! node v6.9.4
npm ERR! npm v4.1.1
npm ERR! code ELIFECYCLE
npm ERR! [email protected] postinstall: node scripts/build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'node scripts/build.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 node-sass package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node scripts/build.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs node-sass
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls node-sass
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request: npm ERR! C:\Users\499705\Desktop\angular cli\npm-debug.log

How can i solve this problem ?
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\angular-cli\node_modules\chokidar\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) npm WARN @angular/[email protected] requires a peer of rxjs@^5.0.1 but none was installed.
C:\Users\Admin\code\ang> C:\Users\Admin\code\ang>ng -v As a forewarning, we are moving the CLI npm package to "@angular/cli" with the next release, which will only support Node 6.9 and greater. This package will be officially deprecated shortly after.
To disable this warning use "ng set --global warnings.packageDeprecation=false".
Cannot find module 'C:\Users\Admin\code\ang\node_modules@angular\common\package.json'
Error: Cannot find module 'C:\Users\Admin\code\ang\node_modules@angular\common\package.json'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Class.getVersion (C:\Users\Admin\AppData\Roaming\npm\node_modules\angular-cli\commands\version.js:70:25)
at C:\Users\Admin\AppData\Roaming\npm\node_modules\angular-cli\commands\version.js:66:67
at Array.forEach (native)
at Class.getDependencyVersions (C:\Users\Admin\AppData\Roaming\npm\node_modules\angular-cli\commands\version.js:66:14)
at C:\Users\Admin\AppData\Roaming\npm\node_modules\angular-cli\commands\version.js:42:58
at Array.forEach (native)
at Class.run (C:\Users\Admin\AppData\Roaming\npm\node_modules\angular-cli\commands\version.js:41:19)
at Class.
C:\Users\Admin\code\ang>node -v v6.10.1
C:\Users\Admin\code\ang> someone please give me a suggestion to solve it
Hi, I'm pretty new to angular, but just in case, to install angular-cli on ubuntu this worked for me:
cd /usr/local/bin(which is my "npm bin -g" directory)sudo npm install -g angcli
Ubuntu 16.04LTS Node v4.2.6 NPM 3.5.2
@jerry3105 works on osx too
$ sudo npm i -g @angular/cli
then...
...
gyp WARN EACCES user "root" does not have permission to access the dev dir "/usr/local/lib/node_modules/@angular/cli/node_modules/node-sass/.node-gyp/8.1.2"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/@angular/cli/node_modules/node-sass/.node-gyp"
gyp verb tmpdir == cwd automatically will remove dev files after to save disk space
gyp verb command install [ '8.1.2' ]
gyp verb install input version string "8.1.2"
gyp verb install installing version: 8.1.2
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version not already installed, continuing with install 8.1.2
gyp verb ensuring nodedir is created /usr/local/lib/node_modules/@angular/cli/node_modules/node-sass/.node-gyp/8.1.2
gyp WARN EACCES user "root" does not have permission to access the dev dir "/usr/local/lib/node_modules/@angular/cli/node_modules/node-sass/.node-gyp/8.1.2"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/@angular/cli/node_modules/node-sass/.node-gyp"
gyp verb tmpdir == cwd automatically will remove dev files after to save disk space
gyp verb command install [ '8.1.2' ]
gyp verb install input version string "8.1.2"
gyp verb install installing version: 8.1.2
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version not already installed, continuing with install 8.1.2
gyp verb ensuring nodedir is created /usr/local/lib/node_modules/@angular/cli/node_modules/node-sass/.node-gyp/8.1.2
...
infinity loops to me
npm install -g angular-cli@latest
appeared to install with this comment: npm WARN @angular/[email protected] requires a peer of rxjs@^5.0.1 but none was installed. new-host:~ walter$
i tried all the solution still "ng" in not recognized. plz help
I have done the npm install -g angular-cli and they show me the following error, how can i fix it to get started with developing for angular js npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/@angular/cli/node_modules/chokidar/node_modules/fsevents):
and when i type ng help nothing happends they just show me that the program is not insatalled install ng-cammon,, thanks
Remove ng file from usr/local/bin
then uninstall
sudo npm uninstall -g @angular/cli
Reinstall
sudo npm install -g @angular/cli
There is no ng file I'n that directory in my computer, On Aug 9, 2017 09:34, "Vishal Anand" [email protected] wrote:
Remove ng file from usr/local/bin then uninstall sudo npm uninstall -g @angular/cli Reinstall sudo npm install -g @angular/cli
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/angular/angular-cli/issues/2161#issuecomment-321166297, or mute the thread https://github.com/notifications/unsubscribe-auth/APKzIvP-IgmyOLgNjat7pxxchc5JV3NJks5sWVMIgaJpZM4J-nHa .
What OS are you using? If you are using Ubuntu, then it will work.
Using Ubuntu 16.04 ,ng file doesn't exist in that folder
can any one help me!..is it recommended to install angular cli using "sudo" (sudo npm install angular-cli )? or without the key word "sudo"?
sudo is a bad idea. I assume in some systems node requires root access to install local or global node packages by default. Consider this article or install node via nvm, version for windows or version for linux and macOS.
Also you can use package managers like Homebrew, Scoop or Chocolatey to install Nodejs
Thanks, @neilhem. Your advice of getting rid of sudo helps me. I've follow this article and after changing npm prefix, @angular/cli installs without problems.