node.js - webpack 构建时缺少绑定(bind)/myproject/node_modules/node-sass/vendor/linux-x64-57/binding.node

标签 node.js npm nvm vue-loader

我在构建项目时遇到以下错误。实际上错误说“缺少绑定(bind)/myproject/node_modules/node-sass/vendor/linux-x64-57/binding.node”,但我有“缺少绑定(bind)/myproject/node_modules/node-sass/vendor/linux-x64-48”/绑定(bind). Node ”。我不知道为什么它没有引用“linux-x64-48”?

错误说运行npm重建node-sass --force,我这样做了,但没有运气。请帮我解决这个问题。

Node 版本:v8.9.1

npm:5.5.1

注意:我什至尝试删除整个node_modules并重新安装(npm install)它。但仍然遇到同样的错误。

ERROR in ./node_modules/css-loader!./node_modules/vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-6ef6ca5e","scoped":true,"hasInlineConfig":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0&bustCache!./src/components/UserProfile.vue
Module build failed: Error: Missing binding /myproject/node_modules/node-sass/vendor/linux-x64-57/binding.node
Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 8.x

Found bindings for the following environments:
  - Linux 64-bit with Node.js 6.x

This usually happens because your environment has changed since running `npm install`.
Run `npm rebuild node-sass --force` to build the binding for your current environment.
    at module.exports (/myproject/node_modules/node-sass/lib/binding.js:15:13)
    at Object.<anonymous> (/myproject/node_modules/node-sass/lib/index.js:14:35)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Module.require (module.js:579:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/myproject/node_modules/sass-loader/lib/loader.js:3:14)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Module.require (module.js:579:17)
 @ ./node_modules/vue-style-loader!./node_modules/css-loader!./node_modules/vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-6ef6ca5e","scoped":true,"hasInlineConfig":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0&bustCache!./src/components/MyProfile.vue 4:14-346 13:3-17:5 14:22-354
 @ ./src/components/UserProfile.vue
 @ ./src/router.js
 @ ./src/main.js
 @ multi ./build/dev-client ./src/main.js

ERROR in ./node_modules/css-loader!./node_modules/sass-loader/lib/loader.js!./src/assets/scss/main.scss
Module build failed: Error: Missing binding /myproject/node_modules/node-sass/vendor/linux-x64-57/binding.node
Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 8.x

Found bindings for the following environments:
  - Linux 64-bit with Node.js 6.x

最佳答案

此问题已通过npm重建node-sass解决,github issue

关于node.js - webpack 构建时缺少绑定(bind)/myproject/node_modules/node-sass/vendor/linux-x64-57/binding.node,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47354850/

相关文章:

node.js - 如何在 ES6 node.js 环境中运行 mediapipe facemesh

node.js - Node JS : Merge two PDF files into one using the buffer obtained by reading them

node.js - 如何在 Mac M1 芯片组上使用 NVM 安装旧版本的 Node.js

zsh - NVM 不坚持使用 ZSH (oh-my-zsh) 的默认别名

node.js - 尝试运行示例的 gulp 问题 - 'The super constructor to ` 继承`不能为空或未定义。

javascript - 使用 Node JS 和 MySql 的搜索功能?

javascript - 如何使用 node.js 连接到 mongodb(并进行身份验证)?

javascript - 无法从node.js更新mongodb中的文档

javascript - Cardlist 未定义 no-undef

javascript - 创建了 package.json 文件,但在运行 npm install 时出现依赖项错误