When Creating a new Angular 5 project:
node version: 8.9.2
npm version: 5.5.1
My Command is
npm install -g @angular/cli
This happens something due to cache or outdated version of Node Package Manager i just updated my NPM it works fine here is command to update Npm to latest version
npm i npm@latest -g
after updating NPM run your desired command
Npm uses Cache for downloading new packages for you. You need to clear your npm cache. use following command to clean :
npm cache clean --force
then normally use your npm install command e.g.
npm install -g @angular/cli
delete npm and npm-cache folders in C:\Users\admin\AppData\Roaming\ (windows) then execute cmd
npm cache clear --force
npm cache verify
update npm to latest version
npm i -g npm
then create your project 1)Angular
npm i -g @angular/cli@latest
ng new HelloWorld
2)React
npm i -g create-react-app
create-react-app react-app
If
npm cache clean --force
doesn't work. try
npm cache clean --force
npm update
You can use yarn package manager instead of npm.
It solved this problem for me
I've faced this issue and I tried all the answers on Stackoverflow but not worked for me, finally I found solution for this issue:
It's worked for me