在编辑器内 运行-运行到微信小程序报以下错误
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 ?
2 个回复
a***@qq.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