ipfs-shipyard / ipfs-deploy

Zero-Config CLI to Deploy Static Websites to IPFS
Other
1.16k stars 122 forks source link

"npx ipfs-deploy" doesn't seem to work without a cache #130

Closed sixcorners closed 3 years ago

sixcorners commented 4 years ago

I can't run "npx ipfs-deploy" by itself.

$ docker run --rm -it node sh -c "npx ipfs-deploy"
Error: EACCES: permission denied, scandir '/root/.npm/_npx/7/lib/node_modules/ipfs-deploy/node_modules/secp256k1'
TypeError: Cannot read property 'get' of undefined
    at errorMessage (/usr/local/lib/node_modules/npm/lib/utils/error-message.js:38:39)
    at errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:201:13)
    at /usr/local/lib/node_modules/npm/bin/npm-cli.js:78:20
    at cb (/usr/local/lib/node_modules/npm/lib/npm.js:225:22)
    at /usr/local/lib/node_modules/npm/lib/npm.js:263:24
    at /usr/local/lib/node_modules/npm/lib/config/core.js:81:7
    at Array.forEach (<anonymous>)
    at /usr/local/lib/node_modules/npm/lib/config/core.js:80:13
    at f (/usr/local/lib/node_modules/npm/node_modules/once/once.js:25:25)
    at /usr/local/lib/node_modules/npm/lib/config/core.js:110:20
TypeError: Cannot read property 'loaded' of undefined
    at exit (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:97:27)
    at process.errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:216:3)
    at process.emit (events.js:210:5)
    at processPromiseRejections (internal/process/promises.js:201:33)
    at processTicksAndRejections (internal/process/task_queues.js:94:32)
/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:97
  var doExit = npm.config.loaded ? npm.config.get('_exit') : true
                          ^

TypeError: Cannot read property 'loaded' of undefined
    at exit (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:97:27)
    at process.errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:216:3)
    at process.emit (events.js:210:5)
    at process._fatalException (internal/process/execution.js:150:25)
internal/modules/cjs/loader.js:895
    throw err;
    ^

Error: Cannot find module '/root/.npm/_npx/7/lib/node_modules/ipfs-deploy/node_modules/ursa-optional/rebuild.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:892:15)
    at Function.Module._load (internal/modules/cjs/loader.js:785:27)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1143:12)
    at internal/main/run_main_module.js:16:11 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ursa-optional@0.10.1 install: `node rebuild.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the ursa-optional@0.10.1 install 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/2020-01-10T19_40_52_900Z-debug.log
Install for [ 'ipfs-deploy@latest' ] failed with code 1

What does this mean?

hacdias commented 3 years ago

You should not run Docker as a root user. Add --user node on that command and you should not have this error again. This error was caused by the transitive dependency secp256k1: https://github.com/cryptocoinjs/secp256k1-node#readme and not by ipfs-deploy itself. I'm going to close this as it is an old issue, but feel free to reopen and ping me directly!