npm install throws: "node postinstall shell-init: error retrieving current directory"
TobiMadeIt opened this issue · 12 comments
Tried install with sudo but no luck. Can provide logs if needed.
`/usr/local/bin/football -> /usr/local/lib/node_modules/footballcli/cli.js
spawn-sync@1.0.15 postinstall /usr/local/lib/node_modules/footballcli/node_modules/spawn-sync
node postinstall
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
path.js:1142
cwd = process.cwd();
^
Error: EACCES: permission denied, uv_cwd
at Error (native)
at Object.resolve (path.js:1142:25)
at startup (bootstrap_node.js:127:32)
at bootstrap_node.js:509:3
/usr/local/lib
└── (empty)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! spawn-sync@1.0.15 postinstall: node postinstall
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the spawn-sync@1.0.15 postinstall script 'node postinstall'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the spawn-sync package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node postinstall
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs spawn-sync
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls spawn-sync
npm ERR! There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/Tobi/.npm/_logs/2017-05-05T00_02_41_132Z-debug.log
`
@TobiMadeIt Thank you for reporting this. Could you please try installing it with sudo
, i.e. sudo npm install -g footballcli
?
I did. Mentioned this in OP btw
@TobiMadeIt Is this happening during install or during usage?
This happens on initial install. My npm version is 4.4.1
@TobiMadeIt Please share your node version, OS and log file created.
node -v is 6.9.5
macOS 10.12.4
Log file is attached.
football.txt
@TobiMadeIt Pretty sure it's not the issue of this package. On searching, one can see multiple instances of reporting this issue. This issue might also depend on the way node was installed (as mentioned in some reported Github issues). Could you please try solution mention here?
I just tried that with no luck. I'm still getting the exact same error. I did some prior research as well. Multiple cases pointed to the package attempting to reference node legacy(node) instead of nodejs. Could that apply to this case?
@TobiMadeIt Try it out. You might also want to give this a try.
I'm a bit wary of
sudo chown -R $USER /usr/local
There doesn't seem to be a straight forward way of reverting the changes and there's a lot of talk warning against leaving things that way security wise.
I did try this though,
sudo chown -R $USER ~/.npm
but that didn't help
@TobiMadeIt Apologies for the delay in replying. Is this still relevant? Were you able to fix it?
@TobiMadeIt I'm closing this issue. If you're still facing this, let me know and I will reopen this.