Windows 10
node 8.9.4
npm 5.6.0
1) few warning during npm instal
...
...
Binary found at C:\Users\XXX\angular\node_modules\node-sass\vendor\win32-x64-57\binding.node
Testing binary
Binary is fine
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\f sevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevent [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x 64"})
added 1069 packages in 708.822s
2) $ npm install -g @angular/cli
npm WARN rollback Rolling back @angular/[email protected] failed (this is probably harmless): EPERM: opera tion not permitted, unlink 'C:\Users\aluft\AppData\Roaming\npm\node_modules\@angular\cli\node_modu les'
npm ERR! path C:\Users\aluft\AppData\Roaming\npm\node_modules\@angular\cli
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall rename
npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\aluft\AppData\Roaming\npm\node_mo dules\@angular\cli' -> 'C:\Users\aluft\AppData\Roaming\npm\node_modules\@angular.cli.DELETE'
npm ERR! { Error: EPERM: operation not permitted, rename 'C:\Users\aluft\AppData\Roaming\npm\node _modules\@angular\cli' -> 'C:\Users\aluft\AppData\Roaming\npm\node_modules\@angular.cli.DELETE'
npm ERR! cause:
npm ERR! { Error: EPERM: operation not permitted, rename 'C:\Users\aluft\AppData\Roaming\npm\no de_modules\@angular\cli' -> 'C:\Users\aluft\AppData\Roaming\npm\node_modules\@angular.cli.DELETE'
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'rename',
npm ERR! path: 'C:\Users\aluft\AppData\Roaming\npm\node_modules\@angular\cli',
npm ERR! dest: 'C:\Users\aluft\AppData\Roaming\npm\node_modules\@angular\.cli.DELETE' },
npm ERR! stack: 'Error: EPERM: operation not permitted, rename \'C:\Users\aluft\AppData\Roam ing\npm\node_modules\@angular\cli\' -> \'C:\Users\aluft\AppData\Roaming\npm\node_modules \@angular\.cli.DELETE\'',
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'rename',
npm ERR! path: 'C:\Users\aluft\AppData\Roaming\npm\node_modules\@angular\cli',
npm ERR! dest: 'C:\Users\aluft\AppData\Roaming\npm\node_modules\@angular\.cli.DELETE' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\aluft\AppData\Roaming\npm-cache_logs\2018-01-10T11_26_42_505Z-debug.log
working angular cli (ng -v ; ng serve etc.)
Worked just fine till last week (don't remember versions),
when I tried to install nvm for managing nvm versions.
Tryed to resolve this issue by (nothing helped):
Resolved by :
npm install [email protected]
after this npm -v still shows 5.6.0
npm install -g @angular/cli
2 days from my life! I hope it's over
Closing as resolved.
still shows command not found !
same, still not able to run ng. I found a path where ng is located and even when I am in that direct folder, I am not able to run ng! what's the deal
Are you using git bash or node.js command prompt?
I faced the same issue when I am working with git bash. But when I tried the same with node.js command prompt. The issue was resolved.
Let me know if it works for you.
Bah... it does not. I'm gonna keep hunting.
i updated to latest node, npm and cli still showing the same error
line 2: ng: command not found
I've fixed this by changing environment variables, PATH and node. I realized that this was a problem on my box rather than ng because any other programs like create-react-app or the vue cli were not working either. Try changing those. Follow this https://github.com/angular/angular-cli/issues/1183
happened to me because i was logged in as the root user
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
Resolved by :
npm install [email protected]
after this npm -v still shows 5.6.0
npm install -g @angular/cli
2 days from my life! I hope it's over