npm install gatsby在WSL中失败

时间:2019-05-04 15:43:08

标签: npm npm-install gatsby contentful

我正在尝试使用WSL在Windows机器上运行此git repo。... git clone https://github.com/contentful/starter-gatsby-blog.git

运行npm install会给我以下错误,这些错误似乎与尝试安装gatsby-plugin-sharp有关。香港专业教育学院试图添加Windows构建工具和Visual Studio C ++ 2015常用工具。不知道我在想什么。

C:\Users\justi\AppData\Local\Microsoft\WindowsApps\ubuntu.exe run "export PATH=/home/linuxbrew/.linuxbrew/bin:$PATH && /home/linuxbrew/.linuxbrew/bin/node /home/linuxbrew/.linuxbrew/lib/node_modules/npm/bin/npm-cli.js install --scripts-prepend-node-path=auto"

> sharp@0.20.5 install /mnt/c/Users/justi/IdeaProjects/starter-gatsby-blog/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)

info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.6.1/libvips-8.6.1-linux-x64.tar.gz
prebuild-install WARN install No prebuilt binaries found (target=12.1.0 runtime=node arch=x64 platform=linux)
make: Entering directory '/mnt/c/Users/justi/IdeaProjects/starter-gatsby-blog/node_modules/sharp/build'
  TOUCH Release/obj.target/libvips-cpp.stamp
  CXX(target) Release/obj.target/sharp/src/common.o
In file included from ../../nan/nan_converters.h:67:0,
                 from ../../nan/nan.h:202,
                 from ../src/common.cc:24:
../../nan/nan_converters_43_inl.h: In static member function 'static Nan::imp::ToFactoryBase<v8::Boolean>::return_t
.........
.........
.........Removing A bunch of variables not compiling
.........
.........
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/linuxbrew/.linuxbrew/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:196:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:256:12)
gyp ERR! System Linux 4.4.0-17763-Microsoft
gyp ERR! command "/home/linuxbrew/.linuxbrew/Cellar/node/12.1.0/bin/node" "/home/linuxbrew/.linuxbrew/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /mnt/c/Users/justi/IdeaProjects/starter-gatsby-blog/node_modules/sharp
gyp ERR! node -v v12.1.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN friendly-errors-webpack-plugin@1.7.0 requires a peer of webpack@^2.0.0 || ^3.0.0 || ^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sharp@0.20.5 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.20.5 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!     /home/jsmith/.npm/_logs/2019-05-04T15_11_23_965Z-debug.log

这里的错误日志过多,因为它太大... https://textuploader.com/1dt49

0 个答案:

没有答案