Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 719
don_jacuzzi Avatar asked Oct 18 '25 10:10

don_jacuzzi


1 Answers

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

like image 81
don_jacuzzi Avatar answered Oct 20 '25 00:10

don_jacuzzi