After updating node.js and npm to current LTS:
node -v
v12.16.0
npm -v
6.13.4
When I'm trying to install @angular-cli following the steps in the documentation, running npm install -g @angular/cli
in the terminal stops the installation and the console output is:
npm install -g @angular/cli
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
/Users/user/.npm-global/bin/ng -> /USERS/USER/.npm-global/lib/node_modules/@angular/cli/bin/ng
> @angular/[email protected] postinstall /USERS/USER/.npm-global/lib/node_modules/@angular/cli
> node ./bin/postinstall/script.js
+ @angular/[email protected]
updated 1 package in 12.202s
And in this case, ng new project-name
yields -bash: ng: command not found
. Any help would be very welcome as I have a big project coming up.
Thanks all.
Unfortunately, Request package was deprecated. and that according to Mikeal Rogers (creator of request) read this link
and for more information, you can read this article
The issue you are experiencing has noting to do with npm warning
you see in console ref. It is seems more likely a problem with permissions on your machine or NodeJS installation issue or both.
I would recommend to remove your NodeJS installation completely at first and then install NVM to manage your NodeJS instances:
Once you done installing NVM try to install Angular CLI:
npm install @angular/cli -g
Hope it helps!
UPDATE: Also you can check this issue
I removed "node_modules" folder & "package-lock.json" file and then execute following 2 commands:
npm init
npm install
And then, it worked properly.
I tried cleaning cache and it worked for me.
npm cache clean --force
The package request is now fully deprecated. So that will probably take a while to change. I think the solution would be for angular cli to release a new version that is not reliant upon request.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With