我的系统中安装了 ionic
。当我运行 ionic run app tabs
时,它会安装所有的 npm
包,但随后提示符变为
Downloading binary from https://github.com/sass/node-sass/releases/download/v4.11.0/linux-x64-72_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.11.0/linux-x64-72_binding.node":
HTTP error 404 Not Found
然后失败并显示提示
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/l3g0b0y/code/greenlink/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.15.0-47-generic
gyp ERR! command "/home/l3g0b0y/.nvm/versions/node/v12.0.0/bin/node" "/home/l3g0b0y/code/greenlink/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /home/l3g0b0y/code/greenlink/node_modules/node-sass
gyp ERR! node -v v12.0.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.8 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.8: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: node-sass@4.11.0 (node_modules/node-sass):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: node-sass@4.11.0 postinstall: `node scripts/build.js`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
我已经尝试删除 node_modules
并重新安装包。我也尝试重新安装 ionic-cli
。哪个不起作用。
我正在使用
Node v12.0.0
npm v6.9.0
ionic v4.12.0
最佳答案
确实,版本 https://github.com/sass/node-sass/releases/download/v4.11.0/linux-x64-72_binding.node
不可用,因为您正在使用 Node v12
并尝试为 Node v12 获取不受支持的 node-sass
版本。
解决方案是将您的 Node 版本降级到 v11
或将您的 node-sass 依赖项升级到最新版本。
如果您(对于与另一个库有相同问题的访问者。这里是 ionic
)正在使用 node-sass
作为供应商库,请降级到 node v11 并通知库开发团队需要更新。
关于node.js - ionic 框架 : Ionic build fails while creating the project (v4. 12.0),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55892917/