raineorshine / solidity-repl

Ethereum Solidity REPL
ISC License
396 stars 33 forks source link

Fails when installing on Ubuntu 18.04 #22

Closed dmdque closed 4 years ago

dmdque commented 6 years ago

I've had no problem installing this on macOS before, but on Ubuntu:

$ sudo npm install -g solidity-repl                                                                                                                                                      ✹
npm WARN deprecated babel-preset-es2015@6.24.1: 🙌  Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update!
/usr/local/bin/solr -> /usr/local/lib/node_modules/solidity-repl/bin.js                                                                                                                                    

> eth-new-contract@0.3.0 postinstall /usr/local/lib/node_modules/solidity-repl/node_modules/eth-new-contract                                              
> npm run build                                                                                                   

> eth-new-contract@0.3.0 build /usr/local/lib/node_modules/solidity-repl/node_modules/eth-new-contract                                                                                                     
> babel -d dist src                                                                                                                                                                                        

Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/solidity-repl/node_modules/eth-new-contract/dist'                                                                                     
    at Object.mkdirSync (fs.js:738:3)                                                                                                                                                                      
    at sync (/usr/local/lib/node_modules/solidity-repl/node_modules/mkdirp/index.js:71:13)                                                                
    at outputFileSync (/usr/local/lib/node_modules/solidity-repl/node_modules/output-file-sync/index.js:44:24)        
    at write (/usr/local/lib/node_modules/solidity-repl/node_modules/babel-cli/lib/babel/dir.js:33:5)                                                                                                      
    at handleFile (/usr/local/lib/node_modules/solidity-repl/node_modules/babel-cli/lib/babel/dir.js:43:7)                                                                                                 
    at /usr/local/lib/node_modules/solidity-repl/node_modules/babel-cli/lib/babel/dir.js:61:9                                                                                                              
    at Array.forEach (<anonymous>)                                                                                                                                                                         
    at handle (/usr/local/lib/node_modules/solidity-repl/node_modules/babel-cli/lib/babel/dir.js:59:29)                                                                                                    
    at Array.forEach (<anonymous>)                                                                                                                                                                         
    at module.exports (/usr/local/lib/node_modules/solidity-repl/node_modules/babel-cli/lib/babel/dir.js:69:15)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! eth-new-contract@0.3.0 build: `babel -d dist src`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the eth-new-contract@0.3.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/solidity-repl/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! eth-new-contract@0.3.0 postinstall: `npm run build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the eth-new-contract@0.3.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/dq/.npm/_logs/2018-07-20T22_33_04_798Z-debug.log

I've tried

sudo mkdir -p /usr/local/lib/node_modules/solidity-repl/node_modules/eth-new-contract/dist

But continue getting similar errors

raineorshine commented 6 years ago

Does this work?

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

Yep, this one worked for me and I was also getting the same issue