Angular-cli: Can't install angular-cli globally

Created on 16 Sep 2016  Â·  61Comments  Â·  Source: angular/angular-cli

Please provide us with the following information:

  1. OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)

Mac OSX El Capitan

  1. Versions. Please run ng --version. If there's nothing outputted, please run
    in a Terminal: node --version and paste the result here:

latest

  1. 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

  1. 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 
  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.

Most helpful comment

npm install -g -f angular-cli @karthikkavin

All 61 comments

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, like sudo npm uninstall -g angular-cli
  • Clone this angular-cli repo,
  • Go to the angular-cli repo folder, and run npm link,
  • Go to my project folder
  • Run npm link angular-cli
  • Now to run ng command, I use ./node_modules/angular-cli/bin/ng from 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 Filesnodejsnode.exe" "C:Usersshekharsu
pDataRoamingnpmnode_modulesnpmbinnpm-cli.js" "install" "-g" "
gular-cli"
npm ERR! node v4.5.0
npm ERR! npm v3.10.6
npm ERR! path C:UsersSHEKHA~1AppDataLocalTempnpm-9268-e64aa74bregi
mjs.orguc.micro
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall mkdir

npm ERR! Error: EPERM: operation not permitted, mkdir 'C:UsersSHEKHA~1
LocalTempnpm-9268-e64aa74bregistry.npmjs.orguc.micro'
npm ERR! at Error (native)
npm ERR! { [Error: EPERM: operation not permitted, mkdir 'C:UsersSHEKH
DataLocalTempnpm-9268-e64aa74bregistry.npmjs.orguc.micro']
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'mkdir',
npm ERR! path: 'C:UsersSHEKHA~1AppDataLocalTempnpm-9268-e64
registry.npmjs.orguc.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:angularnpm-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

screenshot from 2016-10-18 15-52-28

screen shot 2016-10-18 at 3 29 19 pm

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
image

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

Has anyone used yarn package manager. Its fast, easy, understandable (meaningful). You can :

  1. Install yarn
    npm install yarn -g
  2. 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:Users499705Desktopangular 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:Users499705AppDataRoamingnpmng -> C:Users499705AppDataRoamingnpmno
de_modulesangular-clibinng

[email protected] install C:Users499705AppDataRoamingnpmnode_modulesangul
ar-clinode_modulesnode-sass
node scripts/install.js

Cached binary found at C:Users499705AppDataRoamingnpm-cachenode-sass4.5.0
win32-ia32-48_binding.node

[email protected] postinstall C:Users499705AppDataRoamingnpmnode_modulesa
ngular-clinode_modulesnode-sass
node scripts/build.js

Binary found at C:Users499705AppDataRoamingnpmnode_modulesangular-clinod
e_modulesnode-sassvendorwin32-ia32-48binding.node
Testing binary
Binary has a problem: Error: %1 is not a valid Win32 application.
\?C:Users499705AppDataRoamingnpmnode_modulesangular-clinode_modulesno
de-sassvendorwin32-ia32-48binding.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:Users499705AppDataRoamingnpmnode_modulesangular-
clinode_modulesnode-sasslibbinding.js:19:10)
at Object. (C:Users499705AppDataRoamingnpmnode_modulesangu
lar-clinode_modulesnode-sasslibindex.js:14:35)
at Module._compile (module.js:570:32)
Building the binary locally
Building: C:Program Filesnodejsnode.exe C:Users499705AppDataRoamingnpmn
ode_modulesangular-clinode_modulesnode-gypbinnode-gyp.js rebuild --verbose
--libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ 'C:\Program Files\nodejs\node.exe',
gyp verb cli 'C:\Users\499705\AppData\Roaming\npm\node_modules\angular-
cli\node_modules\node-gyp\bin\node-gyp.js',
gyp verb cli 'rebuild',
gyp verb cli '--verbose',
gyp verb cli '--libsass_ext=',
gyp verb cli '--libsass_cflags=',
gyp verb cli '--libsass_ldflags=',
gyp verb cli '--libsass_library=' ]
gyp info using [email protected]
gyp info using [email protected] | win32 | ia32
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb which failed Error: not found: python2
gyp verb which failed at getNotFoundError (C:Users499705AppDataRoaming
npmnode_modulesangular-clinode_moduleswhichwhich.js:13:12)
gyp verb which failed at F (C:Users499705AppDataRoamingnpmnode_modul
esangular-clinode_moduleswhichwhich.js:68:19)
gyp verb which failed at E (C:Users499705AppDataRoamingnpmnode_modul
esangular-clinode_moduleswhichwhich.js:80:29)
gyp verb which failed at C:Users499705AppDataRoamingnpmnode_modules
angular-clinode_moduleswhichwhich.js:89:16
gyp verb which failed at C:Users499705AppDataRoamingnpmnode_modules
angular-clinode_modulesisexeindex.js:44:5
gyp verb which failed at C:Users499705AppDataRoamingnpmnode_modules
angular-clinode_modulesisexewindows.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:Users499705AppDataRoaming
npmnode_modulesangular-clinode_moduleswhichwhich.js:13:12)
gyp verb which failed at F (C:Users499705AppDataRoamingnpmnode_modul
esangular-clinode_moduleswhichwhich.js:68:19)
gyp verb which failed at E (C:Users499705AppDataRoamingnpmnode_modul
esangular-clinode_moduleswhichwhich.js:80:29)
gyp verb which failed at C:Users499705AppDataRoamingnpmnode_modules
angular-clinode_moduleswhichwhich.js:89:16
gyp verb which failed at C:Users499705AppDataRoamingnpmnode_modules
angular-clinode_modulesisexeindex.js:44:5
gyp verb which failed at C:Users499705AppDataRoamingnpmnode_modules
angular-clinode_modulesisexewindows.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:Users499705AppDataRoaming
npmnode_modulesangular-clinode_moduleswhichwhich.js:13:12)
gyp verb which failed at F (C:Users499705AppDataRoamingnpmnode_modul
esangular-clinode_moduleswhichwhich.js:68:19)
gyp verb which failed at E (C:Users499705AppDataRoamingnpmnode_modul
esangular-clinode_moduleswhichwhich.js:80:29)
gyp verb which failed at C:Users499705AppDataRoamingnpmnode_modules
angular-clinode_moduleswhichwhich.js:89:16
gyp verb which failed at C:Users499705AppDataRoamingnpmnode_modules
angular-clinode_modulesisexeindex.js:44:5
gyp verb which failed at C:Users499705AppDataRoamingnpmnode_modules
angular-clinode_modulesisexewindows.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:Users499705AppDataRoaming
npmnode_modulesangular-clinode_moduleswhichwhich.js:13:12)
gyp verb which failed at F (C:Users499705AppDataRoamingnpmnode_modul
esangular-clinode_moduleswhichwhich.js:68:19)
gyp verb which failed at E (C:Users499705AppDataRoamingnpmnode_modul
esangular-clinode_moduleswhichwhich.js:80:29)
gyp verb which failed at C:Users499705AppDataRoamingnpmnode_modules
angular-clinode_moduleswhichwhich.js:89:16
gyp verb which failed at C:Users499705AppDataRoamingnpmnode_modules
angular-clinode_modulesisexeindex.js:44:5
gyp verb which failed at C:Users499705AppDataRoamingnpmnode_modules
angular-clinode_modulesisexewindows.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:Python27python.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:Users499705AppDataRoamingnpmn
ode_modulesangular-clinode_modulesnode-gyplibconfigure.js:454:19)
gyp ERR! stack at Object. (C:Users499705AppDataRoamingnpmno
de_modulesangular-clinode_modulesnode-gyplibconfigure.js:480:16)
gyp ERR! stack at C:Users499705AppDataRoamingnpmnode_modulesangular-c
linode_modulesgraceful-fspolyfills.js:284:29
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:123:15)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\499705\AppDa
ta\Roaming\npm\node_modules\angular-cli\node_modules\node-gyp\bin\node-g
yp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldf
lags=" "--libsass_library="
gyp ERR! cwd C:Users499705AppDataRoamingnpmnode_modulesangular-clinode_m
odulesnode-sass
gyp ERR! node -v v6.9.4
gyp ERR! node-gyp -v v3.5.0
gyp ERR! not ok
Build failed with error code: 1
C:Users499705AppDataRoamingnpm
`-- (empty)

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modulesan
gular-clinode_moduleschokidarnode_modulesfsevents):
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:Users499705Desktopangular clinpm-debug.log

screenshot from 2017-02-25 16-50-01

How can i solve this problem ?

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modulesangular-clinode_moduleschokidarnode_modulesfsevents):
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:UsersAdmincodeang>
C:UsersAdmincodeang>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:[email protected]'
Error: Cannot find module 'C:[email protected]'
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:UsersAdminAppDataRoamingnpmnode_modulesangular-clicommandsversion.js:70:25)
at C:UsersAdminAppDataRoamingnpmnode_modulesangular-clicommandsversion.js:66:67
at Array.forEach (native)
at Class.getDependencyVersions (C:UsersAdminAppDataRoamingnpmnode_modulesangular-clicommandsversion.js:66:14)
at C:UsersAdminAppDataRoamingnpmnode_modulesangular-clicommandsversion.js:42:58
at Array.forEach (native)
at Class.run (C:UsersAdminAppDataRoamingnpmnode_modulesangular-clicommandsversion.js:41:19)
at Class. (C:UsersAdminAppDataRoamingnpmnode_modulesangular-cliember-clilibmodelscommand.js:134:17)
at process._tickCallback (internal/process/next_tick.js:109:7)

C:UsersAdmincodeang>node -v
v6.10.1

C:UsersAdmincodeang>
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:

  1. cd /usr/local/bin (which is my "npm bin -g" directory)
  2. 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

Don't install npm packages with sudo, npm guide or use nvm

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" notifications@github.com 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.

Ugh..same here. It did work with the old package name though: npm install -g -f angular-cli

I was having a problem with node version
I updated from the terminal using install latest (9.2.0)
The Angular/CLI do not suport it
So I did sudo n 8.9.0
I installed again and sudo npm install -g -f @angular/cli
And it worked!!

Hi,

A quick note to share that I uninstalled @angular/cli using:
sudo npm uninstall -g @angular/cli

Then, following option 2 in this article I created a hidden directory in my user directory
mkdir ~/.npm-global

edited ~/.profile to add ~/.npm-global/bin to $PATH
export PATH=~/.npm-global/bin:$PATH

and ran
source ~/.profile

After such steps I was able to install @angular/cli with
npm install -g @angular/cli
without any issues.

Thanks @neilhem

Mute it

Hi all, I had the same issue to install angular-cli and a little bit of Linux knowledge fixed my issue.

For some reason I don know, the /usr/local/lib/node_modules folder was the only one on 400 permission and owned by root.

solution was change the folder's owner

sudo chown -R ericluque:admin /usr/local/lib/node_modules

PS: I'm on Mac OSX High Sierra

Hi

Getting this Bellow Error while installing Angular.js in windows . Can you please help .

npm ERR! TypeError: Cannot read property 'latest' of undefined
npm ERR! at next (D:GovindProjectsnode_modulesnpmlibcache.js:744:35)
npm ERR! at D:GovindProjectsnode_modulesnpmlibcache.js:732:5
npm ERR! at saved (D:GovindProjectsnode_modulesnpmnode_modulesnpm-registry-clientlibget.
js:148:7)
npm ERR! at D:GovindProjectsnode_modulesnpmnode_modulesgraceful-fspolyfills.js:133:7
npm ERR! at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this entire log,
npm ERR! including the npm and node versions, at:
npm ERR! http://github.com/npm/npm/issues

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "D:\Govind\Projects\\node.exe" "D:\Govind\Projects\node_modules\npm\bin\n
pm-cli.js" "install" "-g" "-f" "angular-cli"
npm ERR! cwd D:GovindProjects
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! type non_object_property_load
npm ERR! TypeError: Cannot read property 'latest' of undefined
npm ERR! at next (D:GovindProjectsnode_modulesnpmlibcache.js:744:35)
npm ERR! at D:GovindProjectsnode_modulesnpmlibcache.js:732:5
npm ERR! at saved (D:GovindProjectsnode_modulesnpmnode_modulesnpm-registry-clientlibget.
js:148:7)
npm ERR! at D:GovindProjectsnode_modulesnpmnode_modulesgraceful-fspolyfills.js:133:7
npm ERR! at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this entire log,
npm ERR! including the npm and node versions, at:
npm ERR! http://github.com/npm/npm/issues

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "D:\Govind\Projects\\node.exe" "D:\Govind\Projects\node_modules\npm\bin\n
pm-cli.js" "install" "-g" "-f" "angular-cli"
npm ERR! cwd D:GovindProjects
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! type non_object_property_load

hey try this

step1: npm uninstall -g @angular/cli

step2: npm cache clean

step3:npm install -g @angular/cli@latest

npm cache clean

On Tue, Dec 19, 2017 at 3:46 PM, govindareddy2011 notifications@github.com
wrote:

Hi

Getting this Bellow Error while installing Angular.js . Can you please
help .

npm ERR! TypeError: Cannot read property 'latest' of undefined
npm ERR! at next (D:GovindProjectsnode_modulesnpmlibcache.js:744:35)
npm ERR! at D:GovindProjectsnode_modulesnpmlibcache.js:732:5
npm ERR! at saved (D:GovindProjectsnode_modulesnpmnode_modulesnpm-
registry-clientlibget.
js:148:7)
npm ERR! at D:GovindProjectsnode_modulesnpmnode_modules
graceful-fspolyfills.js:133:7
npm ERR! at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this entire log,
npm ERR! including the npm and node versions, at:
npm ERR! http://github.com/npm/npm/issues
https://github.com/npm/npm/issues

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "D:GovindProjects\node.exe" "D:GovindProjectsnode_
modulesnpmbinn
pm-cli.js" "install" "-g" "-f" "angular-cli"
npm ERR! cwd D:GovindProjects
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! type non_object_property_load
npm ERR! TypeError: Cannot read property 'latest' of undefined
npm ERR! at next (D:GovindProjectsnode_modulesnpmlibcache.js:744:35)
npm ERR! at D:GovindProjectsnode_modulesnpmlibcache.js:732:5
npm ERR! at saved (D:GovindProjectsnode_modulesnpmnode_modulesnpm-
registry-clientlibget.
js:148:7)
npm ERR! at D:GovindProjectsnode_modulesnpmnode_modules
graceful-fspolyfills.js:133:7
npm ERR! at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this entire log,
npm ERR! including the npm and node versions, at:
npm ERR! http://github.com/npm/npm/issues
https://github.com/npm/npm/issues

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "D:GovindProjects\node.exe" "D:GovindProjectsnode_
modulesnpmbinn
pm-cli.js" "install" "-g" "-f" "angular-cli"
npm ERR! cwd D:GovindProjects
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! type non_object_property_load

—
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-352699481,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AY8qabLYdNXSVrRVQfvf4qoGQTlD3RUSks5tB4z-gaJpZM4J-nHa
.

Gave me the same error!!
third time is installed correctly..

getting error while installing angular/cli in ubuntu 16.04.
npm version -: 4.6.1
/root/.nvm/versions/node/v8.9.4/lib/node_modules/@angular/cli/bin/ng

[email protected] install /root/.nvm/versions/node/v8.9.4/lib/node_modules/@angular/cli/node_modules/node-sass
node scripts/install.js

sh: 1: node: Permission denied

[email protected] postinstall /root/.nvm/versions/node/v8.9.4/lib/node_modules/@angular/cli/node_modules/webpack/node_modules/uglifyjs-webpack-plugin
node lib/post_install.js

sh: 1: node: Permission denied
/root/.nvm/versions/node/v8.9.4/lib
`-- (empty)

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":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/@angular/cli/node_modules/webpack-dev-server/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/@angular/cli/node_modules/node-sass):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: node scripts/install.js
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: spawn ENOENT
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! [email protected] postinstall: node lib/post_install.js
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-02-09T19_27_21_111Z-debug.log

I have faced and fixed this issue relates node-sass and python error.Try installing latest angular cli command with the steps below

Set the system variable path as well:
C:UserswindowsusernameAppDataRoamingnpm

C:UserswindowsusernameAppDataRoamingnpmnode_modules@angularclibin;

C:Program Filesnodejs;

Then start using angular cli command prompt using:
angular client project folder path>npm install -g @angular/cli@latest

angular client project folder path>npm install -g node-gyp

node -v
v8.11.1
npm -v
5.6.0
$ npm install -g @angular/cli

ABMs-MacBook-Pro:bin abmrocknuzzaman$ npm install -g @angular/cli
Error: EPERM: operation not permitted, mkdir '/usr/abmrocknuzzaman'
TypeError: Cannot read property 'get' of undefined
at errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:205:18)
at /usr/local/lib/node_modules/npm/bin/npm-cli.js:83:20
at cb (/usr/local/lib/node_modules/npm/lib/npm.js:224:22)
at /usr/local/lib/node_modules/npm/lib/npm.js:262:24
at /usr/local/lib/node_modules/npm/lib/config/core.js:81:7
at Array.forEach ()
at /usr/local/lib/node_modules/npm/lib/config/core.js:80:13
at f (/usr/local/lib/node_modules/npm/node_modules/once/once.js:25:25)
at afterExtras (/usr/local/lib/node_modules/npm/lib/config/core.js:178:20)
at /usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:35:29
at /usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:47:53
at /usr/local/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:284:29
at FSReqWrap.oncomplete (fs.js:152:21)
/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:205
if (npm.config.get('json')) {
^

TypeError: Cannot read property 'get' of undefined
at process.errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:205:18)
at emitOne (events.js:116:13)
at process.emit (events.js:211:7)
at process._fatalException (bootstrap_node.js:375:26)

Please help me how i solve this problem?. I am using Mac. Angular is not installing on my machine.

I have tried so many solutions but after all

:+1: This works for me

npm install -g -f angular-cli

-f - Forcefully we have to install with its dependencies

Just do the following steps:

  • sudo chmod 777 -R /usr/local/bin
  • npm install -g -f @angular/cli

Getting similar error, could use a hand

7100 error path /usr/local/bin/ng
7101 error code EEXIST
7102 error Refusing to delete /usr/local/bin/ng: ../lib/node_modules/angular-cli/bin/ng symlink target is not controlled by npm /usr/local/bin
7103 error File exists: /usr/local/bin/ng
7104 error Move it away, and try again.

Manjaro Deepin

npm ERR! path /usr/lib/node_modules/.staging
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall mkdir
npm ERR! Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/.staging'
npm ERR! { [Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/.staging']
npm ERR! cause:
npm ERR! { Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/.staging'
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/usr/lib/node_modules/.staging' },
npm ERR! stack:
npm ERR! 'Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/.staging'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/usr/lib/node_modules/.staging',
npm ERR! parent: 'webpack-sources' }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).

npm ERR! A complete log of this run can be found in:
npm ERR! /home/deyveson/.npm/_logs/2018-09-27T03_18_16_875Z-debug.log

Hi all, I had the same issue to install angular-cli and a little bit of Linux knowledge fixed my issue.

For some reason I don know, the /usr/local/lib/node_modules folder was the only one on 400 permission and owned by root.

solution was change the folder's owner

sudo chown -R ericluque:admin /usr/local/lib/node_modules

PS: I'm on Mac OSX High Sierra

Thanks eric! This worked for me (High Sierra, late 2018).

Hi,

A quick note to share that I uninstalled @angular/cli using:
sudo npm uninstall -g @angular/cli

Then, following option 2 in this article I created a hidden directory in my user directory
mkdir ~/.npm-global

edited ~/.profile to add ~/.npm-global/bin to $PATH
export PATH=~/.npm-global/bin:$PATH

and ran
source ~/.profile

After such steps I was able to install @angular/cli with
npm install -g @angular/cli
without any issues.

Thanks @neilhem

This worked for us. Missing npm config set prefix '~/.npm-global' step. Check the shared link thoroughly.

-f option didn't work

On MacOS Sierra, node 11 installed with brew.
Everything here didn't work.

I succeed by doing

npm install npm@latest -g
sudo npm i @angular/cli -g -f

Hello friends. I have one issue that each time i type any ng command its ask for google chrome, notepad,etc . and when i hit on google chrome. Its shows like this
54114861_1429849197157493_7407517335063363584_o
54419852_1429849230490823_7434053081832095744_o

Please give me solution, i also downgrade node & angular as well :)

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