imAndy
imAndy
  • 发布:2020-09-12 00:34
  • 更新:2021-08-25 12:53
  • 阅读:1489

VueCli创建的项目安装了node-sass后在HBuilderX中无法运行

分类:HBuilderX

在编辑器内 运行-运行到微信小程序报以下错误

00:08:56.700 Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):  
00:08:56.700 ModuleBuildError: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):  
00:08:56.712 Error: Missing binding /Users/liwuxi/Showtime/yunxiaolv/yunxiaolv_wx/node_modules/node-sass/vendor/darwin-x64-57/binding.node  
00:08:56.729 Node Sass could not find a binding for your current environment: OS X 64-bit with Node.js 8.x  
00:08:56.730 Found bindings for the following environments:  
00:08:56.746   - OS X 64-bit with Node.js 14.x  
00:08:56.746 This usually happens because your environment has changed since running `npm install`.  
00:08:56.762 Run `npm rebuild node-sass` to download the binding for your current environment.

在系统终端运行没有这个问题

大概看了一下好像是 HBuilderX 内置了Node.js 跟系统的 Node.js 版本不一致?

请问如何设置 HBuilderX ?

2020-09-12 00:34 负责人:无 分享
已邀请:
a***@qq.com

a***@qq.com

我也遇到这个问题。

t***@126.com

t***@126.com

cd /Applications/HBuilderX.app/Contents/HBuilderX/plugins/node

mv node node-v8

ln -s /usr/local/bin/node /Applications/HBuilderX.app/Contents/HBuilderX/plugins/node/node

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