don_jacuzzi
don_jacuzzi

Reputation: 91

Permission denied when running NPM postinstall script?

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?

Upvotes: 3

Views: 10840

Answers (1)

don_jacuzzi
don_jacuzzi

Reputation: 91

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

Upvotes: 2

Related Questions