1

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?

4
  • 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. Commented Jun 28, 2017 at 22:43
  • 1
    github.com/nodejs/node-gyp/issues/454 Commented Jun 28, 2017 at 22:44
  • @R.Richards how did you downgrade to 3.1? Commented Jun 28, 2017 at 23:30
  • 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). Commented Jun 28, 2017 at 23:36

2 Answers 2

1

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

Did the trick. Workaround works for now.

Sign up to request clarification or add additional context in comments.

Comments

1

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.