Hi I can't install the angular cli with npm install -g @angular/[email protected]
.
I keep getting this :
> node ./bin/postinstall/script.js
module.js:549
throw err;
^
Error: Cannot find module '/root/.nvm/versions/node/v13.0.1/lib/node_modules/@angular/cli/bin/postinstall/script.js'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:188:16)
at bootstrap_node.js:609:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @angular/[email protected] postinstall: `node ./bin/postinstall/script.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @angular/[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/2019-11-26T00_10_33_515Z-debug.log
Node version : 13.0.1
Npm version : 6.13.1
Ubuntu version : 18.04.2
I also tried without specifying a CLI version.
I tried with this command that I found online :
npm install -g @angular/[email protected] --unsafe-perm=true --allow-root
And it worked.
Try to run with sudo npm
. On Ubuntu, you need to run with root permission. It depends on how you install node.
sudo npm install -g @angular/[email protected]
On the other hand, try to install node 12 and LTS versions to have a more secure version.
Hope it helps
Steps I followed
ng
folder from /root/.nvm/versions/node/v12.3.0/bin
npm install -g @angular/[email protected] --unsafe-perm=true --allow-root
and it worked
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