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

Running from packages that need to be installed globally, it didn't check root permissions. #8

Open
reinaldorauch opened this issue Sep 22, 2017 · 6 comments

Comments

@reinaldorauch
Copy link

When I was installing elm-format globally, which depends on binwrap to install, it crashes with permssions error:

output:

/usr/bin/elm-format -> /usr/lib/node_modules/elm-format/bin/elm-format

> [email protected] install /usr/lib/node_modules/elm-format
> binwrap-install

fs.js:653
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^

Error: EACCES: permission denied, open 'bin/elm-format'
    at Object.fs.openSync (fs.js:653:18)
    at Object.fs.writeFileSync (fs.js:1300:33)
    at /usr/lib/node_modules/elm-format/node_modules/binwrap/install.js:17:8
    at Array.forEach (<anonymous>)
    at install (/usr/lib/node_modules/elm-format/node_modules/binwrap/install.js:15:19)
    at Object.install (/usr/lib/node_modules/elm-format/node_modules/binwrap/index.js:8:14)
    at Object.<anonymous> (/usr/lib/node_modules/elm-format/node_modules/binwrap/bin/binwrap-install:16:9)
    at Module._compile (module.js:624:30)
    at Object.Module._extensions..js (module.js:635:10)
    at Module.load (module.js:545:32)
    at tryModuleLoad (module.js:508:12)
    at Function.Module._load (module.js:500:3)
    at Function.Module.runMain (module.js:665:10)
    at startup (bootstrap_node.js:201:16)
    at bootstrap_node.js:626:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `binwrap-install`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm-install-error.log.txt

@sebn
Copy link

sebn commented Jan 8, 2018

Same issue here. Fedora 27, tried both node 8.9.3 (default) and 8.9.4 (nodesource). With and without sudo.

@sebn
Copy link

sebn commented Jan 8, 2018

Workaround:

sudo npm install -g elm-format --ignore-scripts
cd /usr/lib/node_modules/elm-format/
sudo rm bin/elm-format
sudo npm run install

@sebn
Copy link

sebn commented Jan 19, 2018

Better workaround:

$ npm config get -g user
nobody
$ sudo npm config set -g user root
$ sudo npm install -g elm-format
...
+ [email protected]
added 93 packages in 50.2s

Looks like an npm setup issue, not a binwrap one, at least for me...
@reinaldorauch Could you check on your side?

@reinaldorauch
Copy link
Author

Sorry for the late reply, will test on my coding machine and return to you

@avh4
Copy link
Owner

avh4 commented Apr 26, 2019

Have we been able to figure out if there's something binwrap could be doing differently that would avoid this problem (or give a better error message if it's not avoidable)?

@reinaldorauch
Copy link
Author

@sebn the workaround worked, many thanks

@avh4 I will try to figure it out.

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

3 participants