Closed Spriteware closed 9 years ago
Hey, i also had the same problem but sudo npm install
worked for me.
However, have no idea why this happens..
@Spriteware , Did @hoffi 's solution work for you?
@jansmolders86 Nope, I had tried it but it did not work...
@Spriteware what about a npm install node-gyp?
Same issue here.
$ npm install
pre-processor@0.0.1 preinstall /home/dash/IdeaProjects/DizP/v2/preprocessor node bin/preinstall.js
npm WARN package.json app@1.0.0 No description npm WARN package.json app@1.0.0 No repository field. npm WARN package.json app@1.0.0 No README data \
sqlite3@3.0.5 install /home/dash/IdeaProjects/DizP/v2/preprocessor/lib/app/node_modules/sqlite3 node-pre-gyp install --fallback-to-build
sh: /home/dash/IdeaProjects/DizP/v2/preprocessor/lib/app/node_modules/sqlite3/node_modules/.bin/node-pre-gyp: Permission denied npm ERR! Linux 3.14.37-gentoo npm ERR! argv "node" "/usr/bin/npm" "i" npm ERR! node v0.10.30 npm ERR! npm v2.9.0 npm ERR! code ELIFECYCLE
npm ERR! sqlite3@3.0.5 install: node-pre-gyp install --fallback-to-build
npm ERR! Exit status 126
npm ERR!
npm ERR! Failed at the sqlite3@3.0.5 install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! This is most likely a problem with the sqlite3 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-pre-gyp install --fallback-to-build
npm ERR! You can get their info via:
npm ERR! npm owner ls sqlite3
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request: npm ERR! /home/dash/IdeaProjects/DizP/v2/preprocessor/lib/app/npm-debug.log npm WARN package.json app@1.0.0 No description npm WARN package.json app@1.0.0 No repository field. npm WARN package.json app@1.0.0 No README data
Did you try "sudo install npm"? Really seems like a permission issue
I think it is a npm bug. I have a partition, which is mounted to /home/dash
. Take a look at /etc/fstab
:
/dev/mapper/data /home/dash ext4 rw,user,exec 0 0
I found out on the Internet that the problem might cause the user
attribute. So, I changed the line in /etc/fstab
to:
/dev/mapper/data /home/dash ext4 rw,exec 0 0
And it started to work. However, the permissions are still the same in the both cases.
Super weird! To bad it isn't directly MCJS related or I could have tried to fix it. Glad you got your answer though!
Thanks again!
Had the same issue here. Could solve it by installing node-pre-gyp
module first.
npm install sqlite3
> sqlite3@3.1.2 install /media/D/project/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build
sh: 1: node-pre-gyp: Permission denied
install → rollbackFailedO
[...] Truncated [...]
dv@daniel-zenbook /media/D/project $ npm install -g node-pre-gyp
/home/dv/.nvm/versions/node/v5.5.0/bin/node-pre-gyp -> /home/dv/.nvm/versions/node/v5.5.0/lib/node_modules/node-pre-gyp/bin/node-pre-gyp
/home/dv/.nvm/versions/node/v5.5.0/lib
└── node-pre-gyp@0.6.24
dv@daniel-zenbook /media/D/project $ npm install sqlite3 --save-dev
> sqlite3@3.1.2 install /media/D/project/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build
[sqlite3] Success: "/media/D/project/node_modules/sqlite3/lib/binding/node-v47-linux-x64/node_sqlite3.node" is installed via remote
Project@0.0.1 /media/D/project
└─┬ sqlite3@3.1.2
└── nan@2.2.0
npm WARN EPACKAGEJSON Project@0.0.1 No description
npm WARN EPACKAGEJSON Project@0.0.1 No repository field.
npm WARN EPACKAGEJSON Project@0.0.1 No license field.
dv@daniel-zenbook /media/D/project $
Hope this helps!
Thanks @dvergeylen!!
hello,@dvergeylen: I had the same issue with you when i did: npm install sqlite3 on windows 7. But it does not work with your method?
Hi @michael1389,
I am afraid I can't help you here as I don't have a Windows setup where I installed npm. :-(
@dvergeylen: Hey, i had soved it! I just did :uninstall the node-v4.5.0-x64 ,clear the folder of node_modules,then install the node-v6.10.0-x64,npm install sqlite3 --save,wait a minute...
thank you all the same!
Woot! That's excellent!
It works for me:
npm config set user 0
npm config set unsafe-perm true
@dvergeylen you is teh man! https://media.giphy.com/media/iiS84hOJXh1Pq/giphy.gif
Hi all,
following this commend working fine...:)
#npm install -g node-gyp node-pre-gyp
or $sudo npm install -g node-gyp node-pre-gyp
I just used Yarn
It works for me:
npm config set user 0 npm config set unsafe-perm true
Thanks, it works for me as well!
I was accessing Debian 6 VM via SSH, sudo npm install
didn't work for me. Solution was to login SSH as root user: https://linuxconfig.org/enable-ssh-root-login-on-debian-linux-server
And then using the su
command.
Well can someone explain to me how this work :
i runned npm install sqlite3 as root got permision denied sudo install sqlite3 as root worked... why did i got a perm denied as root but root+sudo worked? mystery
It works for me:
npm config set user 0 npm config set unsafe-perm true
worked fine with yarn😊!
This one worked for me for some reason ¯_(ツ)_/¯
npm install --unsafe-perms
Hi all, following this commend working fine...:)
#npm install -g node-gyp node-pre-gyp
or$sudo npm install -g node-gyp node-pre-gyp
this one works for me!!!
Hi all, following this commend working fine...:)
#npm install -g node-gyp node-pre-gyp
or$sudo npm install -g node-gyp node-pre-gyp
worked for me.
Note: adding unsafe-perm is sketchy in that the root issue is running npm install as root, going to end up running compilers and such as root which can be dangerous.
I ran it as a sub user but then also started having problems with command not found, but I was able to solve that by adding ./node_modules/.bin to PATH (the . is important so it also finds it within sub folders too)
I am not fully sure why its having problems without this in path but it's all I had to do to get it working
my nvm-runner does:
if [ -z "${NVM_DIR-}" ]; then
export NVM_DIR=~/.nvm
fi
export PATH="./node_modules/.bin:$PATH"
NVM_RUNNER_REALPATH=$(realpath "${BASH_SOURCE[0]}");
LOCAL_DIR=$(dirname "$NVM_RUNNER_REALPATH")
if [ -z "$NODE_VERSION" ]; then
NODE_VERSION=$(cat .nvmrc)
fi
export NODE_VERSION
. "${LOCAL_DIR}/nvm.sh" --no-use
if [ ! -d "${NVM_DIR}/versions/node/v${NODE_VERSION}" ]; then
nvm install --no-progress "${NODE_VERSION}"
else
nvm use --silent "${NODE_VERSION}"
fi
# strip yarn - it injects node that overrides
NEW_PATH=$(echo "$PATH" | sed -e "s/\\/tmp\\/yarn\d*-[^\:]*://g")
export PATH="$NEW_PATH"
exec "$@"
Then invoked like this was giving me issues without -u node then even with got command not found.
sudo -u node -H node_modules/.bin/nvm-runner npm rebuild --update-binary
So hopefully this helps people solve this better than the hacky ways suggested above.
Installing pre-gyp globally is a hacky workaround, as you now introduce risk that the pre gyp its running with isn't same version/compat as the one the project defined.
Just in case... I had the same problem and @dashko led me to the right solution. The path containing the node_modules was mounted from an external disk and missing the "exec" option in fstab so that the call of an executable during installation could noch succeed. After adding "exec" and remounting everything worked as expected.
Hi,
I was trying to install mediacenterjs, but
npm install
doesn't work correctly. Here is the error I get :First I taught the problem was from a missing installation of sqlite, so I did
sudo apt-get install sqlite3
, but definitively the main problem seems to benode-pre-gyp: Permission denied
I tried to executenpm install
as root, but it doesn't fix anything. I also tried to executenpm install --unsafe-perms
according to my research on stackoverflow, but it doesn't fix anything too.Do you have any solution ?
Thank you, Spriteware