You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm running an npm install script inside a directory that I've cloned from git, one of the dependancies is Sharp, but when I run npm install, it tells me that node and node-gyp commands don't exist and yells at me about an install script that Sharp tries to execute: (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
My computer is running node 14.15.0 and npm 7.5.2 and it works fine there.
When I try on an Amazon Linux 2 EC2 instance to serve this app on the internet, running node 14.15.0 and npm 6.14.8 (through nvm), I get this crashing error.
Have you ensured the architecture and platform of Node.js used for npm install is the same as the architecture and platform of Node.js used at runtime?
Yes (I think?). Using node 14.15.0 (npm 6.14.8) via nvm
Are you using the latest version? Is the version currently in use as reported by npm ls sharp the same as the latest version as reported by npm view sharp dist-tags.latest?
Yes (0.27.2)
If you are using npm v6 or earlier and installing as a root or sudo user, have you tried with the npm install --unsafe-perm flag?
Yes, I get the same error
If you are using npm v7, does the user running npm install own the directory it is run in?
N/A
If you are using the ignore-scripts feature of npm, have you tried with the npm install --ignore-scripts=false flag?
I don't use ignore-scripts, but I tried the flag regardless and got the same error.
What is the complete output of running npm install --verbose sharp? Have you checked this output for useful error messages?
Please can you ensure that Node.js has been installed correctly. I notice you're using nvm and running as sudo/root - check that it has modified the PATH correctly - you might have run into nvm-sh/nvm#43
lovell
changed the title
sharp install script causing error and refusing to install
"node: command not found" when using nvm and sudo/root
Mar 22, 2021
@lovell thanks for your quick reply. Weirdly, I think I've fixed it. I changed my node version to 14.15.0 on my EC2 instance, but installed the latest version of npm using nvm install --latest-npm which brought me to npm version 7.6.3 which I think solved my issue.
I had to run npm rebuild sharp and then managed to do npm install and it seemed to work no problem for me.
Not sure what the overriding issue was, perhaps a mismatch in npm versions?
Either way, this is solved for me for now so I'll close the comment. Loving Sharp by the way!
I'm running an
npm install
script inside a directory that I've cloned from git, one of the dependancies is Sharp, but when I runnpm install
, it tells me thatnode
andnode-gyp
commands don't exist and yells at me about an install script that Sharp tries to execute:(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
My computer is running node 14.15.0 and npm 7.5.2 and it works fine there.
When I try on an Amazon Linux 2 EC2 instance to serve this app on the internet, running node 14.15.0 and npm 6.14.8 (through nvm), I get this crashing error.
Did you see the documentation relating to installation?
Yes
Have you ensured the architecture and platform of Node.js used for
npm install
is the same as the architecture and platform of Node.js used at runtime?Yes (I think?). Using node 14.15.0 (npm 6.14.8) via nvm
Are you using the latest version? Is the version currently in use as reported by
npm ls sharp
the same as the latest version as reported bynpm view sharp dist-tags.latest
?Yes (0.27.2)
If you are using npm v6 or earlier and installing as a
root
orsudo
user, have you tried with thenpm install --unsafe-perm
flag?Yes, I get the same error
If you are using npm v7, does the user running
npm install
own the directory it is run in?N/A
If you are using the
ignore-scripts
feature ofnpm
, have you tried with thenpm install --ignore-scripts=false
flag?I don't use
ignore-scripts
, but I tried the flag regardless and got the same error.What is the complete output of running
npm install --verbose sharp
? Have you checked this output for useful error messages?What is the output of running
npx envinfo --binaries --system
?The text was updated successfully, but these errors were encountered: