1

I followed this post to unload the old installation with these steps:

[sudo] npm uninstall -g @angular/cli
[sudo] npm cache verify
[sudo] npm install -g @angular/cli

The last step gave me trouble - the console screen just keep scrolling with this message, till I had to ctrl+C it.

gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/@angular/cli/node_modules/node-sass/.node-gyp"
gyp verb tmpdir == cwd automatically will remove dev files after to save disk space
gyp verb command install [ '8.1.4' ]
gyp verb install input version string "8.1.4"
gyp verb install installing version: 8.1.4
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version not already installed, continuing with install 8.1.4
gyp verb ensuring nodedir is created /usr/local/lib/node_modules/@angular/cli/node_modules/node-sass/.node-gyp/8.1.4

I tried googling it and it seemed to be a npm versioning issue, but with no more useful info.

J.E.Y
  • 1,173
  • 2
  • 15
  • 37

1 Answers1

0

The failing component seems to be the node-sass dependency.

This problem could happen due to several issues:

  • Does the path /usr/local/lib/node_modules/ exist and is writable? Are you able to install other global NPM packages?
  • Historically there were issues installing the CLI on systems with less than 1 GB RAM like in Docker containers and in some CI agents. If this is a VM, try increasing the RAM
  • Is your OS supported by node-sass? This is usually never an issue, but just in case. Maybe try installing node-gyp package explicitly npm i -g node-gyp. Sometimes this helps with packages that need building like node-sass. similarly you might need git if you don't have it
Meligy
  • 35,654
  • 11
  • 85
  • 109
  • 1
    i used ubuntu 16.04 VM, and memory is sufficient. I did run npm i -g node-gyp explicitly and it went through. Then I tried "npm install -g @angular/cli" again and this time it seemed worked. Thank you! – J.E.Y Jul 29 '17 at 04:40