I have a postinstall script in my package.json file for a node module, that locates a file within the node module and copies it to another directory. if I run the post install script by itself, it executes without issue. However, when I make a tarball of the module and try to install it in another repo, I get a permission denied and exit status 126 message. I tried simplifying the file to a single console.log("foo") line and it still fails to execute. I have manually checked all permissions the target directory and all its parent directories; they are read-write for everyone (Mac). Has anyone encountered this?
Asked
Active
Viewed 1.0k times
3
-
Google says "exit status 126" means it's a permissions problem or the script is not an executable. Since you know it's an executable, that leaves the permissions. You've checked the read/write permissions, but what about the execute permission of the file? – Sunil D. Aug 28 '15 at 03:09
-
Thanks, Sunil. I have manually changed all the permissions to read/write, used sudo, and tried --unsafe all to no avail. Any ideas? – don_jacuzzi Aug 28 '15 at 05:54
1 Answers
2
I hadn't found this thread until it showed up as related to my posted question, but this solved my problem.
npm install - how to run build scripts with sufficient permissions?
Thanks to Pascal Belloncle

Community
- 1
- 1

don_jacuzzi
- 91
- 1
- 1
- 7