raineorshine / solgraph

Visualize Solidity control flow for smart contract security analysis. :dollar: ⇆ :dollar:

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Installation error: EACCES: permission denied

lorien opened this issue Β· comments

lorien@air:/web/token_qwerty$ sudo npm install --save -g solgraph
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! 
npm WARN deprecated jade@0.26.3: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated to-iso-string@0.0.2: to-iso-string has been deprecated, use @segment/to-iso-string instead.
npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
/usr/bin/solgraph -> /usr/lib/node_modules/solgraph/solgraph.js

> solgraph@0.2.6 postinstall /usr/lib/node_modules/solgraph
> npm run build

npm ERR! path /root/.npm/_logs
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall scandir
npm ERR! Error: EACCES: permission denied, scandir '/root/.npm/_logs'
npm ERR!  { Error: EACCES: permission denied, scandir '/root/.npm/_logs'
npm ERR!   stack: 'Error: EACCES: permission denied, scandir \'/root/.npm/_logs\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'scandir',
npm ERR!   path: '/root/.npm/_logs' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.
glob error { Error: EACCES: permission denied, scandir '/root/.npm/_logs'
  stack: 'Error: EACCES: permission denied, scandir \'/root/.npm/_logs\'',
  errno: -13,
  code: 'EACCES',
  syscall: 'scandir',
  path: '/root/.npm/_logs' }

> solgraph@0.2.6 build /usr/lib/node_modules/solgraph
> babel -d dist src

Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/solgraph/dist'
    at Object.fs.mkdirSync (fs.js:892:18)
    at sync (/usr/lib/node_modules/solgraph/node_modules/mkdirp/index.js:71:13)
    at outputFileSync (/usr/lib/node_modules/solgraph/node_modules/output-file-sync/index.js:44:24)
    at write (/usr/lib/node_modules/solgraph/node_modules/babel-cli/lib/babel/dir.js:33:5)
    at handleFile (/usr/lib/node_modules/solgraph/node_modules/babel-cli/lib/babel/dir.js:43:7)
    at /usr/lib/node_modules/solgraph/node_modules/babel-cli/lib/babel/dir.js:61:9
    at Array.forEach (<anonymous>)
    at handle (/usr/lib/node_modules/solgraph/node_modules/babel-cli/lib/babel/dir.js:59:29)
    at Array.forEach (<anonymous>)
    at module.exports (/usr/lib/node_modules/solgraph/node_modules/babel-cli/lib/babel/dir.js:69:15)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! solgraph@0.2.6 build: `babel -d dist src`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the solgraph@0.2.6 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              npm update check failed              β”‚
β”‚        Try running with sudo or get access        β”‚
β”‚       to the local update config store via        β”‚
β”‚ sudo chown -R $USER:$(id -gn $USER) /root/.config β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.2 (node_modules/solgraph/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 243
npm ERR! solgraph@0.2.6 postinstall: `npm run build`
npm ERR! Exit status 243
npm ERR! 
npm ERR! Failed at the solgraph@0.2.6 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!     /root/.npm/_logs/2017-10-08T02_05_08_724Z-debug.log

npm: 5.3.0
node: 8.6.0
os: debian stretch

Content of /root/.npm/_logs/2017-10-08T02_05_08_724Z-debug.log attached.
2017-10-08T02_05_08_724Z-debug.log

commented

same here

commented

@lorien i tried to make a new directory for solgraph, and under that directory use npm install. then everything runs well

@d0o0 Tried your approach by add --prefix in the npm install, but it seems to make the same error :(

@d0o0 I just used your approach and npm install --save -g solgraph worked. Thanks

This worked for me:

sudo npm install --save -g solgraph --unsafe-perm=true --allow-root