1
votes

I'm trying to install the Angular 2 CLI on a El Capitan machine with: node 7.10.0 and npm 5.0.

I get the following recursive error during installation:

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.0.0' ]
gyp verb install input version string "8.0.0"
gyp verb install installing version: 8.0.0
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version not already installed, continuing with install 8.0.0
gyp verb ensuring nodedir is created /usr/local/lib/node_modules/@angular/cli/node_modules/node-sass/.node-gyp/8.0.0
gyp WARN EACCES user "root" does not have permission to access the dev dir "/usr/local/lib/node_modules/@angular/cli/node_modules/node-sass/.node-gyp/8.0.0"
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.0.0' ]
gyp verb install input version string "8.0.0"
gyp verb install installing version: 8.0.0
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version not already installed, continuing with install 8.0.0
gyp verb ensuring nodedir is created /usr/local/lib/node_modules/@angular/cli/node_modules/node-sass/.node-gyp/8.0.0
gyp WARN EACCES user "root" does not have permission to access the dev dir "/usr/local/lib/node_modules/@angular/cli/node_modules/node-sass/.node-gyp/8.0.0"
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.0.0' ]
gyp verb install input version string "8.0.0"
gyp verb install installing version: 8.0.0
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version not already installed, continuing with install 8.0.0
gyp verb ensuring nodedir is created /usr/local/lib/node_modules/@angular/cli/node_modules/node-sass/.node-gyp/8.0.0
gyp WARN EACCES user "root" does not have permission to access the dev dir "/usr/local/lib/node_modules/@angular/cli/node_modules/node-sass/.node-gyp/8.0.0"
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.0.0' ]
gyp verb install input version string "8.0.0"
gyp verb install installing version: 8.0.0
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version not already installed, continuing with install 8.0.0
gyp verb ensuring nodedir is created /usr/local/lib/node_modules/@angular/cli/node_modules/node-sass/.node-gyp/8.0.0

I've uninstalled it by using

sudo npm uninstall -g @angular/cli

and reinstalled it by using

sudo npm install -g @angular/cli

Insight into what may be causing this and how to fix it?

2
npm 5.0 seems to be the issue. I had to downgrade (3.10 with node 6.11) to get my install to work on Mint.R. Richards
@R.Richards how did you downgrade to 3.1?atherton
I used the Software Manager in Mint to do the uninstall, then I followed the install instructions here to install node 6.11 (6.x).R. Richards

2 Answers

1
votes

sudo npm install --unsafe-perm --verbose -g @angular/cli

Did the trick. Workaround works for now.

1
votes

Another way to resolve this is to install gyp and @angular/cli explicitly.

sudo npm install gyp @angular/cli -g

If it fails again, try to install gyp first and then the CLI.