Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't install on mac #19

Closed
souvikhaldar opened this issue Aug 21, 2018 · 4 comments
Closed

Can't install on mac #19

souvikhaldar opened this issue Aug 21, 2018 · 4 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@souvikhaldar
Copy link

souvikhaldar commented Aug 21, 2018

When trying to install it throws permission error. Even when tried installing by becoming root then also getting error of the following form:-
gyp WARN EACCES user "root" does not have permission to access the dev dir "/usr/local/lib/node_modules/terminalizer/node_modules/node-pty-prebuilt/.node-gyp/8.11.4" gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/terminalizer/node_modules/node-pty-prebuilt/.node-gyp"

@faressoft
Copy link
Owner

You need to fix the permissions

chown -R faressoft /usr/local/lib/node_modules
chown -R faressoft /usr/local/bin
chown -R faressoft /usr/local/share

Change faressoft to your username.

@souvikhaldar
Copy link
Author

Still getting the same error.

@faressoft
Copy link
Owner

Please execute and give me the results of

ls -l /usr/local/lib/node_modules/terminalizer
ls -ld /usr/local/lib/node_modules/terminalizer
ls -ld /usr/local/lib/node_modules
ls -ld /usr/local/bin
ls -ld /usr/local/share

@faressoft faressoft added help wanted Extra attention is needed good first issue Good for newcomers labels Aug 22, 2018
@jukefr
Copy link

jukefr commented Aug 24, 2018

You could try this nodejs/node-gyp#454 (comment)

sudo npm install --unsafe-perm --verbose -g sails

When installing with sudo.

As for the reason an install currently won't work for you without a sudo is because it is trying to add global packages to /usr/local/lib/... and most operating systems will have permissions set to root for these folders.

If you are getting started with npm I would suggest you try and read this https://docs.npmjs.com/getting-started/fixing-npm-permissions (and the entire getting-started wiki for that matter) it talks about the NPM_CONFIG_PREFIX environment variable which allows you to set a custom global install path, preferably at your user's home folder (~ or /Users/$USER) this way you will not need sudo to install global packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants