Open JimVanEeden opened 7 years ago
I also encountered this issue on Arch linux.
Same issue on OSX 10.12.6 and npm 5.3.0.
Thank you for reporting.
I think this is a legitimate issue because I just tried on npmc
(their canary). I previously have had no problems with npmc
, so something changed with how either npm handles permissions, or how we alter permissions on our releases. Old npm still works well for me, as you've noted.
I found that when I do npmc install -g --ignore-scripts reason-cli-url
, the resulting directory looks like this:
total 184
drwxr-xr-x 16 me 1876110778 544B Aug 27 23:59 ./
drwxr-xr-x 6 me 1876110778 204B Aug 27 23:59 ../
drwxr-xr-x 22 me 1876110778 748B Aug 27 23:59 .bin/
-rw-r--r-- 1 me 1876110778 10B Jul 9 17:55 .npmignore
-rw-r--r-- 1 me 1876110778 407B Jul 9 17:55 .travis.yml
-rw-r--r-- 1 me 1876110778 1.0K Jul 9 17:55 LICENSE
-rw-r--r-- 1 me 1876110778 714B Jul 9 17:55 Makefile
-rw-r--r-- 1 me 1876110778 184B Jul 9 17:55 ORIGINS.md
-rw-r--r-- 1 me 1876110778 6.6K Jul 9 17:55 README.md
-rw-r--r-- 1 me 1876110778 3.3K Aug 27 23:59 package.json
-rw-r--r-- 1 me 1876110778 11K Jul 9 17:55 postinstall.sh
-rw-r--r-- 1 me 1876110778 11K Jul 9 17:55 prerelease.sh
drwxr-xr-x 5 me 1876110778 170B Aug 27 23:59 records/
-rw-r--r-- 1 me 1876110778 33K Jul 9 17:55 rel.tar.gz
drwxr-xr-x 3 me 1876110778 102B Aug 27 23:59 relBinaries/
drwxr-xr-x 4 me 1876110778 136B Aug 27 23:59 releaseUtils/
npmc
has removed the executable permissions from postinstall.sh
! This might be a bug on their end, or a new security feature. Does anyone know?
This issue supposedly says it's fixed, but it still looks broken to me (in the latest canary (5.4 canary 1)).
I've filed an issue here on npm's repo. It looks like it's a bug in npm5 :(
We can do sh ./postinstall.sh
as a workaround?
@andreypopp Yes, you should be able to do npmc install -g --ignore-scripts theUrl
, and then cd
into the npm install location, then chmod 777 postinstall.sh
, and then ./postinstall.sh
.
But if it's the case that npm5
is messing up permissions upon installation, then I would say that npm5
isn't ready for use yet. If it's something we're doing incorrectly, that's another story but so far it looks like a pretty clear cut case of an npm bug.
@jordwalke thanks for answer. It help!
A little hint who stucked with that problem too:
npm global packages folder can be found by $ npm list -g
.
For example, at Fedora path is /usr/lib/node_modules/reason-cli/
What did you have to do to get it working?
Same issue on OSX 10.12.6 , node 8.7.0 and npm 5.4.2
@mikowiec do you use nvm
or something like that or this was just plain brew
install of Node?
do you use nvm or something like that or this was just plain brew install of Node?
No, I've installed the latest release node-v8.7.0.pkg from nodejs.org I've make workaround with postinstall.sh and installation finished well. But, the similarly issue occurred when I installed "bs-platform" for testing purposes.
I've uninstalled v8.7 and then installed LTS node-v6.11.4.pkg (where is npm 3.10.10). Then installed "bs-platform" and made the simple project. It was OK for LTS and fault for latest node (npm).
update: brew installed node gave the same issue
My NPM version is 5.5.1
and I still had this issue. Jordan's workaround above worked fine though.
@adrianmcli and what is your OS? Are you using the npmc canary? or official npm release?
@jordwalke I was using official npm release 5.5.1
on Mac OS 10.12.6
Sierra. Willing to try other combinations if you'd like.
Same issue with npm 5.6.0
As explained in the other opened issue, I fixed it in this way:
MacOs 10.13.2, npm 5.6 and node 9.2.0.
To fix it, I ran npm install
with the --ignore-scripts
flag to not execute the faulty post-install script:
npm install -g --ignore-scripts https://github.com/reasonml/reason-cli/archive/3.0.4-bin-darwin.tar.gz
inside the installation dir .nvm/versions/node/v9.2.0/lib/node_modules/reason-cli/
I had to change the file ownership and group because they were totally wrong:
ll ~/.nvm/versions/node/v9.2.0/lib/node_modules/reason-cli/r/build-eject/bin/esyImportBuild
-rwx------ 1 653775386 1876110778
sudo chown -R $USER r
execute the postinstall script with sudo
sudo ./bin/esyBuildRelease bin install
and everything worked.
It could be that passing --unsafe-perm
to the npm install could fix the issue as well but I didn't try it as I already spent 2 hours trying to fix the issue.
On Mac OSX 10.13 you have to add --unsafe-perm
npm install -g --unsafe-perm electron-icon-generator
When trying to install with
npm install -g https://github.com/reasonml/reason-cli/archive/beta-v-1.13.6-bin-linux.tar.gz
, using npm 5.3.0, the installation fails with the following error:Using my previous npm version (4.1.2), the installation does work. Haven't tried any other versions of npm, just thought you should know this.