raineorshine / solidity-repl

Ethereum Solidity REPL
ISC License
396 stars 33 forks source link

Can't install due to bignumber dependency #16

Open charlieg-nuco opened 6 years ago

charlieg-nuco commented 6 years ago

sudo npm install -g solidity-repl

npm ERR! code 1
npm ERR! Command failed: /usr/bin/git clone --depth=1 -q -b master https://github.com/debris/bignumber.js.git /home/me/.npm/_cacache/tmp/git-clone-ca773fe1
npm ERR! /home/me/.npm/_cacache/tmp/git-clone-ca773fe1/.git: Permission denied

I can install bigint just fine though and I also have ethereumjs-testrpc

I have admin permissions a shown by using sudo.

raineorshine commented 6 years ago

It installs fine for me. If someone can reproduce and troubleshoot I'd be happy to review a PR.

rjperry611 commented 6 years ago

I'm getting the same error. I'm trying to install on linux mint 18 using npm 6.1.0 and node 8.11.1

raineorshine commented 6 years ago

Can you try the unsafe-perm flag:

sudo npm install -g solidity-repl --unsafe-perm=true --allow-root
rjperry611 commented 6 years ago

Tried it and still getting the same error.

rjperry611 commented 6 years ago

Here is a printout from the debug log:

743 silly fetchPackageMetaData error for bignumber.js@git+https://github.com/debris/bignumber.js.git#master Command failed: /usr/bin/git clone --depth=1 -q -b master https://github.com/debris/bignumber.js.git /home/lezorte/.npm/_cacache/tmp/git-clone-72e5e7f9
743 silly fetchPackageMetaData /home/lezorte/.npm/_cacache/tmp/git-clone-72e5e7f9/.git: Permission denied
744 timing stage:rollbackFailedOptional Completed in 1ms
745 timing stage:runTopLevelLifecycles Completed in 6275ms
746 verbose stack Error: Command failed: /usr/bin/git clone --depth=1 -q -b master https://github.com/debris/bignumber.js.git /home/lezorte/.npm/_cacache/tmp/git-clone-72e5e7f9
746 verbose stack /home/lezorte/.npm/_cacache/tmp/git-clone-72e5e7f9/.git: Permission denied
746 verbose stack
746 verbose stack     at ChildProcess.exithandler (child_process.js:275:12)
746 verbose stack     at emitTwo (events.js:126:13)
746 verbose stack     at ChildProcess.emit (events.js:214:7)
746 verbose stack     at maybeClose (internal/child_process.js:925:16)
746 verbose stack     at Socket.stream.socket.on (internal/child_process.js:346:11)
746 verbose stack     at emitOne (events.js:116:13)
746 verbose stack     at Socket.emit (events.js:211:7)
746 verbose stack     at Pipe._handle.close [as _onclose] (net.js:567:12)
747 verbose cwd /home/lezorte
748 verbose Linux 4.4.0-53-generic
749 verbose argv "/usr/bin/node" "/usr/bin/npm" "i" "-g" "solidity-repl" "--unsafe-perm=true" "--allow-root"
750 verbose node v8.11.1
751 verbose npm  v6.1.0
752 error code 1
753 error Command failed: /usr/bin/git clone --depth=1 -q -b master https://github.com/debris/bignumber.js.git /home/lezorte/.npm/_cacache/tmp/git-clone-72e5e7f9
753 error /home/lezorte/.npm/_cacache/tmp/git-clone-72e5e7f9/.git: Permission denied
754 verbose exit [ 1, true ]
rjperry611 commented 6 years ago

I'd be happy to try to mess with the code and make a PR but I literally don't see where in the package.json it calls for git. If you can get me started, I can try to fix it for ya

raineorshine commented 6 years ago

To be honest, I think you're looking in the wrong place. This is not code that is part of solidity-repl, nor likely part of bignumber.js. I do not know where the git clone is originating, but as it is part of the installation process I would guess it is in npm. You could try posting an issue there and see if someone has seen this before. I am guessing there is something wrong with your permissions on /home/lezorte/.npm/.

You may also consider nvm which sandboxes node and tends to result in fewer permission errors.