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

Installation problem #554

Open
fabricemarchal opened this issue Sep 21, 2018 · 6 comments
Open

Installation problem #554

fabricemarchal opened this issue Sep 21, 2018 · 6 comments

Comments

@fabricemarchal
Copy link

fabricemarchal commented Sep 21, 2018

sudo bash
npm install -g elm-format

generates the following error:
ERR Error extracting https://github.com/avh4/elm-format/releases/download/0.8.0/elm-format-0.19-0.8.0-mac-x64.tgz - Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/elm-format/unpacked_bin'
with --unsafe-perm it works.

@avh4
Copy link
Owner

avh4 commented Oct 2, 2018

Is this on Mac or Linux?

In general, I'd recommend installing elm-format as a non-root user. Is there a reason you need it installed as root?

I'm not familiar with --unsafe-perm. What does it do? Is the elm-format package doing something wrong that leads to this error?

@fabricemarchal
Copy link
Author

The problem was on Mac. I installed first as user but got some permissions errors (hence the sudo).

@Erudition
Copy link

Erudition commented Nov 3, 2018

I've had the same problem since 0.19 was released so I could never upgrade.
Via npm/npm#17268 I eventually discovered the --unsafe-perm trick, which works. Might want to make note of that in the install instructions for now. Also, make the title of this issue more specific.

sudo npm install -g elm-format
/usr/bin/elm-format -> /usr/lib/node_modules/elm-format/bin/elm-format

> elm-format@0.8.1 install /usr/lib/node_modules/elm-format
> binwrap-install

ERR Error extracting https://github.com/avh4/elm-format/releases/download/0.8.1/elm-format-0.8.1-linux-x64.tgz - Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/elm-format/unpacked_bin'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! elm-format@0.8.1 install: `binwrap-install`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the elm-format@0.8.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

@dustypaws
Copy link

@Erudition saved my bacon! Thank you! :D

@shepelevstas
Copy link

shepelevstas commented Apr 23, 2020

--unsafe-perm worked! Shouldn't it be mentioned in docs? The issue is almost 2 years old!
Great tool btw!!! =D

@bhstremblay
Copy link

bhstremblay commented May 17, 2020

Isn't this more an issue with managing the permissions around installing npm pacakges, and not elm-specific?

I'm new to using npm but see this section on their site. I was getting permission denied installing elm-test and elm-format so I did the second suggestion from that page, i.e.

mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
NPM_CONFIG_PREFIX=~/.npm-global npm install -g elm-test elm-format

and that worked for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants