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
Even if npm cache clean --force
Try to execute the installing cmd in admin folder.
i.e C:\Users\admin
This worked out for me.
I resolved my problem with this one liner
npm cache clean --force
It works like a charm all the time. I love one liners. Note: since its a clean install, I had no concerns emptying npm cache.
Simple solutions:
npm cache clean --force
npm install
I solved that by first cleaning the cache using
npm cache clean --force
Then
npm install -g @angular/cli
Instead of clearing the cache you can set a temporary folder:
npm install --cache /tmp/empty-cache
or
npm install --global --cache /tmp/empty-cache
As of npm@5, the npm cache self-heals from corruption issues and data extracted from the cache is guaranteed to be valid. If you want to make sure everything is consistent, use
npm cache verify
instead. On the other hand, if you're debugging an issue with the installer, you can usenpm install --cache /tmp/empty-cache
to use a temporary cache instead of nuking the actual one.
For me I had to clone my branch again and do npm install