错误:使用离子服务时缺少绑定

时间:2019-07-04 14:01:09

标签: node-modules ionic4 serve

我正在努力为我的离子项目服务。但是当我运行离子服务时,会出现以下错误!

模块构建失败(来自./node_modules/sass-loader/lib/loader.js): [ng]错误:缺少绑定/home/gideon/node_modules/node-sass/vendor/linux-x64-57/binding.node

我试图运行“ $ npm rebuild node-sass”,但是它给了我错误。 我还删除了node-sass文件夹,然后再次运行“ $ npm install”,但仍然无法执行并返回相同的错误。


ERROR in ./src/global.scss (./node_modules/@angular-devkit/build-angular/src/angular-cli-files/plugins/raw-css-loader.js!./node_modules/postcss-loader/src??embedded!./node_modules/sass-loader/lib/loader.js??ref--14-3!./src/global.scss)
[ng] Module build failed (from ./node_modules/sass-loader/lib/loader.js):
[ng] Error: Missing binding /home/gideon/node_modules/node-sass/vendor/linux-x64-57/binding.node
[ng] Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 8.x
[ng] 
[ng] Found bindings for the following environments:
[ng]   - Linux 64-bit with Node.js 10.x
[ng] 
[ng] This usually happens because your environment has changed since running `npm install`.
[ng] Run `npm rebuild node-sass` to download the binding for your current environment.
[ng]     at module.exports (/home/gideon/node_modules/node-sass/lib/binding.js:15:13)
[ng]     at Object.<anonymous> (/home/gideon/node_modules/node-sass/lib/index.js:14:35)
[ng]     at Module._compile (module.js:653:30)
[ng]     at Object.Module._extensions..js (module.js:664:10)
[ng]     at Module.load (module.js:566:32)
[ng]     at tryModuleLoad (module.js:506:12)
[ng]     at Function.Module._load (module.js:498:3)
[ng]     at Module.require (module.js:597:17)
[ng]     at require (internal/module.js:11:18)
[ng]     at Object.sassLoader (/home/gideon/IONIC/ionic-news-app-master/node_modules/sass-loader/lib/loader.js:46:72)
[ng] ERROR in ./src/theme/variables.scss (./node_modules/@angular-devkit/build-angular/src/angular-cli-files/plugins/raw-css-loader.js!./node_modules/postcss-loader/src??embedded!./node_modules/sass-loader/lib/loader.js??ref--14-3!./src/theme/variables.scss)
[ng] Module build failed (from ./node_modules/sass-loader/lib/loader.js):
[ng] Error: Missing binding /home/gideon/node_modules/node-sass/vendor/linux-x64-57/binding.node
[ng] Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 8.x
[ng] 
[ng] Found bindings for the following environments:
[ng]   - Linux 64-bit with Node.js 10.x
[ng] 
[ng] This usually happens because your environment has changed since running `npm install`.
[ng] Run `npm rebuild node-sass` to download the binding for your current environment.
[ng]     at module.exports (/home/gideon/node_modules/node-sass/lib/binding.js:15:13)
[ng]     at Object.<anonymous> (/home/gideon/node_modules/node-sass/lib/index.js:14:35)
[ng]     at Module._compile (module.js:653:30)
[ng]     at Object.Module._extensions..js (module.js:664:10)
[ng]     at Module.load (module.js:566:32)
[ng]     at tryModuleLoad (module.js:506:12)
[ng]     at Function.Module._load (module.js:498:3)
[ng]     at Module.require (module.js:597:17)
[ng]     at require (internal/module.js:11:18)
[ng]     at Object.sassLoader (/home/gideon/IONIC/ionic-news-app-master/node_modules/sass-loader/lib/loader.js:46:72)
[ng] ERROR in ./src/app/home/home.page.scss
[ng] Module build failed (from ./node_modules/sass-loader/lib/loader.js):
[ng] Error: Missing binding /home/gideon/node_modules/node-sass/vendor/linux-x64-57/binding.node
[ng] Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 8.x
[ng] 
[ng] Found bindings for the following environments:
[ng]   - Linux 64-bit with Node.js 10.x
[ng] 
[ng] This usually happens because your environment has changed since running `npm install`.
[ng] Run `npm rebuild node-sass` to download the binding for your current environment.
[ng]     at module.exports (/home/gideon/node_modules/node-sass/lib/binding.js:15:13)
[ng]     at Object.<anonymous> (/home/gideon/node_modules/node-sass/lib/index.js:14:35)
[ng]     at Module._compile (module.js:653:30)
[ng]     at Object.Module._extensions..js (module.js:664:10)
[ng]     at Module.load (module.js:566:32)
[ng]     at tryModuleLoad (module.js:506:12)
[ng]     at Function.Module._load (module.js:498:3)
[ng]     at Module.require (module.js:597:17)
[ng]     at require (internal/module.js:11:18)
[ng]     at Object.sassLoader (/home/gideon/IONIC/ionic-news-app-master/node_modules/sass-loader/lib/loader.js:46:72)
[ng] ℹ 「wdm」: Failed to compile.

请务必提供帮助!有人来帮助我!谢谢!

2 个答案:

答案 0 :(得分:0)

解决问题的步骤 运行

  

npm重建node-sass

为您的当前环境构建绑定。

答案 1 :(得分:0)

  

尝试一下

rm -r node_modules
rm package-lock.json
npm install --save-dev node-sass ***or*** npm rebuild node-sass --force
npm install