由于 node-sass 错误,Ionic 无法构建应用程序
Ionic cannot build app due to node-sass error
我正在尝试部署我的离子应用程序,但它不断抛出以下错误:
ionic2Project@2.4.1 build /builds//awaken-app
> ionic-app-scripts build
/builds///node_modules/@ionic/app-scripts/node_modules/node-sass/lib/binding.js:15
throw new Error(errors.missingBinary());
^
Error: Missing binding /builds///node_modules/@ionic/app-scripts/node_modules/node-sass/vendor/linux-x64-64/binding.node
Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 10.x
Found bindings for the following environments:
- OS X 64-bit with Node.js 12.
它似乎适用于 node-sass@4.12.0
,但 ionic-app-scripts
在 package.json
中有 node-sass@4.10.0
。
当我尝试在本地重建 node-sass
时,我看到以下错误:
$ npm rebuild node-sass
> node-sass@4.10.0 install /Users//node_modules/node-sass
> node scripts/install.js
Downloading binary from https://github.com/sass/node-sass/releases/download/v4.10.0/darwin-x64-72_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.10.0/darwin-x64-72_binding.node":
HTTP error 404 Not Found
可能值得注意我是 运行 node@12.8.1
我的 mac 是 运行 OSX Mojave 10.14.6.
Node-sass 不支持每个版本的所有组合。
您的命令 npm rebuild node-sass
是正确的,但您需要查看发布页面以了解适合您的 node-sass 版本。
仅仅升级到最新版本并不总是有效。
它在 npm package page 上说:
Supported Node.js versions vary by release, please consult the releases page
所以这意味着您的特定组合可能需要您通过以下方式降级到较旧的 Node-sass:
- 查看适当版本的发布页面
- 正在 package.json
中编辑您的版本
- 然后做
npm install
- 然后再次
npm rebuild node-sass
。
云机更新
您现在提到您不是在本地计算机上构建,而是在云计算机上完成。
如果这是一些构建服务,那么您需要向他们开具支持票,让他们为您安装支持。
如果这是您自己的 VM,那么您需要在该云计算机上执行我最初回答中的步骤。
我正在尝试部署我的离子应用程序,但它不断抛出以下错误:
ionic2Project@2.4.1 build /builds//awaken-app
> ionic-app-scripts build
/builds///node_modules/@ionic/app-scripts/node_modules/node-sass/lib/binding.js:15
throw new Error(errors.missingBinary());
^
Error: Missing binding /builds///node_modules/@ionic/app-scripts/node_modules/node-sass/vendor/linux-x64-64/binding.node
Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 10.x
Found bindings for the following environments:
- OS X 64-bit with Node.js 12.
它似乎适用于 node-sass@4.12.0
,但 ionic-app-scripts
在 package.json
中有 node-sass@4.10.0
。
当我尝试在本地重建 node-sass
时,我看到以下错误:
$ npm rebuild node-sass
> node-sass@4.10.0 install /Users//node_modules/node-sass
> node scripts/install.js
Downloading binary from https://github.com/sass/node-sass/releases/download/v4.10.0/darwin-x64-72_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.10.0/darwin-x64-72_binding.node":
HTTP error 404 Not Found
可能值得注意我是 运行 node@12.8.1
我的 mac 是 运行 OSX Mojave 10.14.6.
Node-sass 不支持每个版本的所有组合。
您的命令 npm rebuild node-sass
是正确的,但您需要查看发布页面以了解适合您的 node-sass 版本。
仅仅升级到最新版本并不总是有效。
它在 npm package page 上说:
Supported Node.js versions vary by release, please consult the releases page
所以这意味着您的特定组合可能需要您通过以下方式降级到较旧的 Node-sass:
- 查看适当版本的发布页面
- 正在 package.json 中编辑您的版本
- 然后做
npm install
- 然后再次
npm rebuild node-sass
。
云机更新
您现在提到您不是在本地计算机上构建,而是在云计算机上完成。
如果这是一些构建服务,那么您需要向他们开具支持票,让他们为您安装支持。
如果这是您自己的 VM,那么您需要在该云计算机上执行我最初回答中的步骤。