angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Fresh install of @angular/cli fails in Fedora 26 and ubuntu 16 LTS

Open harilal opened this issue 9 years ago • 5 comments

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ ] feature request

A fresh install of cli fails in fedora and ubuntu. The issue with node-sass it can't create the folders due to EACCESS issue. i have rectified the problem in fedora by removing node_modules folder from /usr/lib/node_modules/@angular/cli and running npm install by root user. But this doesn't solved the issue in ubuntu. I still get error Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/@angular/cli/node_modules/node-sass/build' gyp ERR! System Linux 4.10.0-37-generic gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/@angular/cli/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library=" gyp ERR! cwd /usr/lib/node_modules/@angular/cli/node_modules/node-sass gyp ERR! node -v v8.7.0 gyp ERR! node-gyp -v v3.6.2 gyp ERR! not ok Build failed with error code: 1

Versions.

@angular/cli: 1.4.9 node: 8.7.0 os: linux x64

Repro steps.

A fresh install of nodejs and cli in fedora and ubuntu

The log given by the failure.

EACCES user "root" does not have permission to access the dev dir "/usr/lib/node_modules/@angular/cli/node_modules/node-sass/.node-gyp/8.7.0" gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/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

Desired functionality.

Mention any other details that might be useful.

harilal avatar Oct 21 '17 15:10 harilal

I suggest following instructions on this page.

sarunint avatar Oct 23 '17 11:10 sarunint

I found that one before. But it's suggests to create a new directory for npm global modules. If we do like so it will be for the current user right? The error is it's not installing the node-gyp for node-sass.

harilal avatar Oct 24 '17 08:10 harilal

This is indeed a problem with permissions in NPM, as shown in the link by @sarunint. I'm sorry but there isn't anything we can do about it in Angular CLI. You really need to fix your npm setup permissions.

filipesilva avatar Oct 25 '17 10:10 filipesilva

@filipesilva I have found the issue. It's with node-sass. node-sass require node-gyp and node-gyp failed to install . The solution are to npm -g @angular/cli --unsafe-perm. or change npm permission https://docs.npmjs.com/getting-started/fixing-npm-permissions

More details in here https://github.com/nodejs/node-gyp/issues/115

harilal avatar Oct 26 '17 05:10 harilal

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.