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
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.