我正在尝试安装hello world gatsby网站。 我正在遵循gatsby docs安装指南。 设置环境后(具有node,gatsby和git)
我在Linux终端上写:$ gatsby new gatsby-site
但是我遇到了以下错误
info Installing packages...
> sharp@0.23.0 install /home/blink22/Desktop/gatsby-site/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
info sharp Using cached /home/blink22/.npm/_libvips/libvips-8.8.1-linux-x64.tar.gz
ERR! sharp Please delete /home/blink22/.npm/_libvips/libvips-8.8.1-linux-x64.tar.gz as it is not a valid tarball
ERR! sharp zlib: unexpected end of file
info sharp Attempting to build from source via node-gyp but this may fail due to the above error
info sharp Please see https://sharp.pixelplumbing.com/page/install for required dependencies
make: Entering directory '/home/blink22/Desktop/gatsby-site/node_modules/sharp/build'
TOUCH Release/obj.target/libvips-cpp.stamp
CXX(target) Release/obj.target/sharp/src/common.o
../src/common.cc:25:10: fatal error: vips/vips8: No such file or directory
#include <vips/vips8>
^~~~~~~~~~~~
compilation terminated.
sharp.target.mk:127: recipe for target 'Release/obj.target/sharp/src/common.o' failed
make: *** [Release/obj.target/sharp/src/common.o] Error 1
make: Leaving directory '/home/blink22/Desktop/gatsby-site/node_modules/sharp/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:196:23)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Linux 5.0.0-25-generic
gyp ERR! command "/usr/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/blink22/Desktop/gatsby-site/node_modules/sharp
gyp ERR! node -v v8.10.0
gyp ERR! node-gyp -v v5.0.3
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.0.7 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.0.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sharp@0.23.0 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.23.0 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:
ERROR
util.getSystemErrorName is not a function
TypeError: util.getSystemErrorName is not a function
- error.js:11 getCode[lib]/[gatsby-cli]/[execa]/lib/error.js:11:16
- error.js:50 makeError[lib]/[gatsby-cli]/[execa]/lib/error.js:50:35
- index.js:112 handlePromise[lib]/[gatsby-cli]/[execa]/index.js:112:26
- next_tick.js:188 process._tickCallbackinternal/process/next_tick.js:188:7