c***@sina.com
c***@sina.com
  • 发布:2021-06-21 18:24
  • 更新:2021-06-22 00:45
  • 阅读:1080

使用vue-cli创建小程序项目,然后安装node-sass 6.0.0后编译报错,求解。

分类:HBuilderX

[HBuilder] 18:20:14.124 Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
[HBuilder] 18:20:14.125 ModuleError: Module Error (from ./node_modules/sass-loader/dist/cjs.js):
[HBuilder] 18:20:14.155 Missing binding /Users/huangchao/works/Git/mini-wx-demo/node_modules/node-sass/vendor/darwin-x64-72/binding.node
[HBuilder] 18:20:14.155 Node Sass could not find a binding for your current environment: OS X 64-bit with Node.js 12.x
[HBuilder] 18:20:14.172 Found bindings for the following environments:
[HBuilder] 18:20:14.172 - OS X 64-bit with Node.js 14.x
[HBuilder] 18:20:14.198 This usually happens because your environment has changed since running npm install.
[HBuilder] 18:20:14.198 Run npm rebuild node-sass to download the binding for your current environment.
[HBuilder] 18:20:14.219 at Object.emitError (/Users/huangchao/works/Git/mini-wx-demo/node_modules/webpack/lib/NormalModule.js:173:6)
[HBuilder] 18:20:14.219 at getSassImplementation (/Users/huangchao/works/Git/mini-wx-demo/node_modules/sass-loader/dist/utils.js:59:21)
[HBuilder] 18:20:14.241 at Object.loader (/Users/huangchao/works/Git/mini-wx-demo/node_modules/sass-loader/dist/index.js:35:59)
[HBuilder] 18:20:14.241 ERROR Build failed with errors.

项目地址:https://github.com/chao921125/mini-app

2021-06-21 18:24 负责人:无 分享
已邀请:
chenli

chenli

node-sass版本过高不兼容问题,安装4.x版本可以解决问题

  • c***@sina.com (作者)

    不行,我都试过啦,如果直接用命令编译能过去,但是用hbuildx编译就不行

    2021-06-24 10:55

  • c***@sina.com (作者)

    谢答,我手动将包拷贝过去了

    2021-06-24 11:20

该问题目前已经被锁定, 无法添加新回复