我正在跑步sudo npm run build
,它说找不到sass的绑定。我目前仅安装了一个npm版本,它是11.13.0
我试过npm install node-sass
,npm rebuild node-sass
,npm uninstall -save node-sass
,npm install -save node-sass
,npm cache clean
,除去competely节点和node_modules文件夹,但仍然得到同样的错误。但是我确实已经安装了8.0.0版本,但是我使用nvm将其删除了
ERROR in ./src/main/webapp/styles/styles.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/main/webapp/styles/styles.scss)
Module build failed (from ./node_modules/sass-loader/lib/loader.js):
Error: Missing binding /home/dev/IdeaProjects/web-project/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 11.x
如果您需要任何其他信息,请告诉我。
这是由于项目中使用的节点版本与全局安装的节点版本之间不匹配。
npm clean-install
在项目目录中进行操作来清除项目的node_modules文件夹npm install
再次安装所有软件包的问题node -v
确定活动的节点版本。如果输出的版本与您在项目中设置的版本匹配,则npm run build
命令将起作用。如果它们不匹配,则必须安装节点的匹配版本,或者如果您正在使用nvm,请使用:nvm use <version>
激活匹配的版本。本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句