avh4 / avh4/binwrap

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

Open
#8 6 comments 1 reaction 0 assignees View on GitHub
help wanted but probably not easy
Dominant language
JavaScript
Stars
39
Forks
15
PR merge metrics
No merged PRs in 30d

Description

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

> elm-format@0.6.1-alpha 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 ()
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. (/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! elm-format@0.6.1-alpha install: `binwrap-install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the elm-format@0.6.1-alpha install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
```

[npm-install-error.log.txt](https://github.com/avh4/binwrap/files/1325386/npm-install-error.log.txt)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the binwrap install.js and binwrap-install entry point named in the stack trace, then reproduce the global npm installation using the attached error output. Done means the installer handles the global-install permission case without the reported EACCES failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.