Closed daniel-vera-g closed 5 years ago
Getting the exact same
Getting the same when doploying with Now:
01/13 12:26 PM (2m)
npm ERR!
01/13 12:26 PM (2m)
code ELIFECYCLE
01/13 12:26 PM (2m)
npm
01/13 12:26 PM (2m)
ERR! errno 1
01/13 12:26 PM (2m)
npm ERR!
01/13 12:26 PM (2m)
sharp@0.21.1 install: `(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)`
npm ERR! Exit status 1
01/13 12:26 PM (2m)
npm ERR!
01/13 12:26 PM (2m)
npm ERR! Failed at the sharp@0.21.1 install script.
npm
01/13 12:26 PM (2m)
ERR! This is probably not a problem with npm. There is likely additional logging output above.
01/13 12:26 PM (2m)
01/13 12:26 PM (2m)
npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/.npm/_logs/2019-01-13T11_26_07_178Z-debug.log
01/13 12:26 PM (2m)
Error: Exited with 1
at ChildProcess.child.on (/tmp/utils/node_modules/@now/build-utils/fs/run-user-scripts.js:11:16)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:925:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
01/13 12:26 PM (2m)
patching https://api-bru1.zeit.co/v2/now/deployments/dpl_HZht3e8cq2R6y9g9sfMA2k1TSNvb/builds/bld_d6h4vyl1x with {"readyState":"ERROR","errorCode":"BUILD_FAILED_2"}
Getting the same, ubuntu 18.10
error An unexpected error occurred: "EACCES: permission denied, unlink '/home/jonathan/git/jonsjournal/node_modules/gatsby-plugin-sharp/node_modules/fs-extra/CHANGELOG.md'".
npm ERR! sharp@0.21.1 install:
(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy) npm ERR! Exit status 1
I was able to install on another machine with the same OS. Any idea what I might be missing on the machine that doesn't work?
same issue
What version of sharp is installed?
npm list --pattern sharp
There are probably 2 issues here EACCESS error:
EACCESS is mostly caused by wrong permissions on a folder or bad node installation.
you could try to remove node_modules and try npm install
all over again, if it doesn't work try sudo npm install
.
You could also try the following: (only applies to WSL, osx or linux)
Reinstall npm with a node version manager§ This is the best way to avoid permissions issues. To reinstall npm with a node version manager, follow the steps in “Downloading and installing Node.js and npm”. You do not need to remove your current version of npm or Node.js before installing a node version manager.
now.sh:
Getting the same when doploying with Now:
It could be that now.sh doesn't allow installation of sharp. You might want to have a look at http://sharp.pixelplumbing.com/en/stable/install/#libvips
The issue in my case seemed to be related to npm. I have reinstalled node and npm and everything works fine.
I was able to install on another machine with the same OS. Any idea what I might be missing on the machine that doesn't work?
Same with me. Installed it on a VM and it works there. But on my machine not.
UPDATE:
Now it seems to work. After @wardpeet suggestion. I have no idea why.
What version of sharp is installed?
npm list --pattern sharp
There are probably 2 issues here EACCESS error:
EACCESS is mostly caused by wrong permissions on a folder or bad node installation. you could try to remove node_modules and try
npm install
all over again, if it doesn't work trysudo npm install
.You could also try the following: (only applies to WSL, osx or linux)
Reinstall npm with a node version manager§ This is the best way to avoid permissions issues. To reinstall npm with a node version manager, follow the steps in “Downloading and installing Node.js and npm”. You do not need to remove your current version of npm or Node.js before installing a node version manager.
now.sh:
Getting the same when doploying with Now:
It could be that now.sh doesn't allow installation of sharp. You might want to have a look at http://sharp.pixelplumbing.com/en/stable/install/#libvips
Thanks for your reply. Removing node_modules
and doing npm install
made it work again.
Nevertheless I tried the same extensively before submitting this issue and it did not work back then. Strange. Maybe someone fixed something in some package.
I did all the steps outlined here. Reinstalled node, messed with permissions, deleted node_modules and package.json. I wasn't able to get it working until I finally deleted the project and re-cloned it from github. works now :)
I did all the steps outlined here. Reinstalled node, messed with permissions, deleted node_modules and package.json. I wasn't able to get it working until I finally deleted the project and re-cloned it from github. works now :)
There was something strange. Did the same a week ago. It did not work. Yesterday I only deleted the node_modules folder and reinstalled them and it just worked.
I managed to resolve this issue.
Firstly, CD into your new gatsby project folder and run
yarn upgrade --latest
then
yarn install
then gatsby develop
If that doesn't work for you, I resolved the issue by installing node 8.14 (I'm not sure if this part is totally necessary, but this is how I got it to work) by doing:
nvm install v8.14
I then switched to that instance
nvm use v8.14
installed the gatsby package
npm install --global gatsby-cli
created a new project and cd'd into the directory
gatsby new website
cd website
did a yarn update and install
yarn upgrade --latest
yarn install
then ran
gatsby develop
Let me know if it helped you!
Hiya!
This issue has gone quiet. Spooky quiet. 👻
We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here.
If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!
Thanks for being a part of the Gatsby community! 💪💜
Hey again!
It’s been 30 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it.
Please keep in mind that I’m only a robot, so if I’ve closed this issue in error, I’m HUMAN_EMOTION_SORRY
. Please feel free to reopen this issue or create a new one if you need anything else.
Thanks again for being part of the Gatsby community!
Never sudo npm
anything - source. Use npm install --unsafe-perm=true
I just had the same issue and I could resolve it by installing sharp first: npm install sharp
and then all npm modules npm install
That it does it installs the newer version of sharp and it seems to solving the problem.
The same for me, W10 and NodeJS v12.6.0, yarn gave the sharp error (with my repo, cloned in a new computer)
I've gone to NodeJS v10.16.0 and yarn has succeeded, and everything works
@kuworking is right. it's not working with v 12.6.0
, only with 10.16.0
.
I don't really like jumping into issues that are marked closed but, given I found this when searching for an answer to my problem, it makes sense to.
I'm on Windows 10, using NodeJS v12.6 and npm 6.9.0, and had sharp failing to work or install. Deleting the node_modules
directory wasn't enough - I was still getting errors when trying to install again. Then I realised that the package-lock.json
file was probably guiding the reinstallation and that hadn't changed, so I deleted that as well as the node_modules
. Running npm i
this time worked perfectly.
Same here @IrregularShed, I picked up a Gatsby site I hadn't touched for a while and ran into the issue.
Removing node_modules
alone didn't fix it, but deleting my yarn.lock
did.
@robinmetral Great, I'll give that a go when I get a chance
None of the suggestions above worked for me (yarn, OS X, node 12.9.1) except for downgrading to Node 10, cleaning the yarn cache, rmving node_modules, running yarn install
Annoying having to downgrade my node version for some image processing functionality I don't even use, but better than nothing I guess.
Same here, I have to set Node to 10.17.0 in Gitlab CI pipeline otherwise I can't build.... :(
you should download the libvips tar package manually, then put it into a folder named “_libvips” which you should found it in global cache folder. Then you can try another install ,and it works!
yarn work for me too!
nothing's working for me.
same issue building Gatsby site (Mac M1).
This worked: rm -rf node_modules rm package-lock.json npm install sharp npm install
@rickschmoo Tried all this in Mac M1
sharp@0.22.1 install /Users/udittakkar/projects/Rocket.Chat/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
info sharp Using cached /Users/udittakkar/.npm/_libvips/libvips-8.7.4-darwin-x64.tar.gz
prebuild-install WARN install No prebuilt binaries found (target=14.17.6 runtime=node arch=x64 libc= platform=darwin)
TOUCH Release/obj.target/libvips-cpp.stamp
CXX(target) Release/obj.target/sharp/src/common.o
CXX(target) Release/obj.target/sharp/src/metadata.o
CXX(target) Release/obj.target/sharp/src/stats.o
../src/stats.cc:130:19: error: no matching member function for call to 'Set'
channels->Set(i, channelStat);
~~~~~~~~~~^~~
/Users/udittakkar/.meteor/packages/meteor-tool/.2.3.6.1qoxqnl.3ahk++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/include/node/v8.h:3670:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
^
/Users/udittakkar/.meteor/packages/meteor-tool/.2.3.6.1qoxqnl.3ahk++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/include/node/v8.h:3673:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
^
1 error generated.
make: *** [Release/obj.target/sharp/src/stats.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/udittakkar/.meteor/packages/meteor-tool/.2.3.6.1qoxqnl.3ahk++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:400:28)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Darwin 20.6.0
gyp ERR! command "/Users/udittakkar/.meteor/packages/meteor-tool/.2.3.6.1qoxqnl.3ahk++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/bin/node" "/Users/udittakkar/.meteor/packages/meteor-tool/.2.3.6.1qoxqnl.3ahk++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/udittakkar/projects/Rocket.Chat/node_modules/sharp
gyp ERR! node -v v14.17.6
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm WARN The package eslint-plugin-import is included as both a dev and production dependency.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sharp@0.22.1 install: `(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sharp@0.22.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/udittakkar/.npm/_logs/2021-09-13T20_26_58_161Z-debug.log
@rickschmoo Tried all this in Mac M1
sharp@0.22.1 install /Users/udittakkar/projects/Rocket.Chat/node_modules/sharp > (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy) info sharp Using cached /Users/udittakkar/.npm/_libvips/libvips-8.7.4-darwin-x64.tar.gz prebuild-install WARN install No prebuilt binaries found (target=14.17.6 runtime=node arch=x64 libc= platform=darwin) TOUCH Release/obj.target/libvips-cpp.stamp CXX(target) Release/obj.target/sharp/src/common.o CXX(target) Release/obj.target/sharp/src/metadata.o CXX(target) Release/obj.target/sharp/src/stats.o ../src/stats.cc:130:19: error: no matching member function for call to 'Set' channels->Set(i, channelStat); ~~~~~~~~~~^~~ /Users/udittakkar/.meteor/packages/meteor-tool/.2.3.6.1qoxqnl.3ahk++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/include/node/v8.h:3670:37: note: candidate function not viable: requires 3 arguments, but 2 were provided V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, ^ /Users/udittakkar/.meteor/packages/meteor-tool/.2.3.6.1qoxqnl.3ahk++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/include/node/v8.h:3673:37: note: candidate function not viable: requires 3 arguments, but 2 were provided V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index, ^ 1 error generated. make: *** [Release/obj.target/sharp/src/stats.o] Error 1 gyp ERR! build error gyp ERR! stack Error: `make` failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/Users/udittakkar/.meteor/packages/meteor-tool/.2.3.6.1qoxqnl.3ahk++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23) gyp ERR! stack at ChildProcess.emit (events.js:400:28) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12) gyp ERR! System Darwin 20.6.0 gyp ERR! command "/Users/udittakkar/.meteor/packages/meteor-tool/.2.3.6.1qoxqnl.3ahk++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/bin/node" "/Users/udittakkar/.meteor/packages/meteor-tool/.2.3.6.1qoxqnl.3ahk++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /Users/udittakkar/projects/Rocket.Chat/node_modules/sharp gyp ERR! node -v v14.17.6 gyp ERR! node-gyp -v v5.1.0 gyp ERR! not ok npm WARN The package eslint-plugin-import is included as both a dev and production dependency. npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! sharp@0.22.1 install: `(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the sharp@0.22.1 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /Users/udittakkar/.npm/_logs/2021-09-13T20_26_58_161Z-debug.log
I'm having this same issue trying to upgrade a site, any guidance would be greatly appreciated.
@rickschmoo @twobitEDD Hi, did you manage to fix it? I have the same problem in OS M1, any contribution comes in handy!
Yes, I was able to do the following steps and was able to build:
sudo rm -rf node_modules
sudo rm package-lock.json
sudo npm install sharp --unsafe-perm
sudo gatsby build
https://geedew.com/What-does-unsafe-perm-in-npm-actually-do/
I'm still not sure why this happened...
Same issue form me on M1 mac with pnpm
.
Description
I am using
"gatsby-plugin-sharp": "^2.0.17",
as well as"gatsby-transformer-sharp": "^2.1.3"
. After installing, it seems that there is an issue installing the sharp dependency.Steps to reproduce
Expected result
Everything installed properly.
Actual result
Environment
UPDATE:
Before submitting this issue I tried extensively nearly everything, including removing
node_modules
andnpm install
everything again. It didn't work.After waiting a week I tried after @wardpeet suggestion removing
node_modules
andnpm install
everything again. Now ot works. I have no clue why or what did not work a week ago. Maybe an package update?