I'm not sure if this is not caused by something outside of esy or not.
esy version:
none
Operating System:
禄 uname -a
Linux iyu 5.0.0-arch1-1-ARCH #1 SMP PREEMPT Mon Mar 4 14:11:43 UTC 2019 x86_64 GNU/Linux
禄 npm -version
6.8.0
Issue:
Installation of esy with npm fails when running sudo npm install -g esy.
Package.json
none
Actual behavior:
禄 sudo npm install -g esy
/usr/bin/esy -> /usr/lib/node_modules/esy/_build/default/bin/esy.exe
> [email protected] postinstall /usr/lib/node_modules/esy/node_modules/esy-solve-cudf
> node ./postinstall.js
fs.js:119
throw err;
^
Error: EACCES: permission denied, rename '/usr/lib/node_modules/esy/node_modules/esy-solve-cudf/platform-linux/esySolveCudfCommand.exe' -> '/usr/lib/node_modules/esy/node_modules/esy-solve-cudf/esySolveCudfCommand.exe'
at Object.renameSync (fs.js:614:3)
at install (/usr/lib/node_modules/esy/node_modules/esy-solve-cudf/postinstall.js:10:6)
at Object.<anonymous> (/usr/lib/node_modules/esy/node_modules/esy-solve-cudf/postinstall.js:16:5)
at Module._compile (internal/modules/cjs/loader.js:738:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:749:10)
at Module.load (internal/modules/cjs/loader.js:630:32)
at tryModuleLoad (internal/modules/cjs/loader.js:570:12)
at Function.Module._load (internal/modules/cjs/loader.js:562:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:801:12)
at internal/main/run_main_module.js:21:11
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node ./postinstall.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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/2019-03-08T21_48_47_246Z-debug.log
npm works for other packages, i.e.:
禄 sudo npm install uglify-js --global
/usr/bin/uglifyjs -> /usr/lib/node_modules/uglify-js/bin/uglifyjs
+ [email protected]
added 3 packages from 38 contributors in 0.591s
Expected behavior:
Install completes without error
Additional steps to reproduce:
none
have the same error here. any ideas?
If you install with npm as root you need to use --unsafe-perm=true flag:
npm install -g esy --unsafe-perm=true
Works like a charm. Didn't know about the --unsafe-perm=true flag. Thx!
Most helpful comment
If you install with
npmasrootyou need to use--unsafe-perm=trueflag: