npm报错Node Sass could not find a binding for your current environment

目录

  • 一、问题描述
  • 二、解决方法


一、问题描述

npm install 执行报错 Node Sass could not find a binding for your current environment:

ERROR  Failed to compile with 1 error                                                                                                                                                          6:35:24 PM

 error  in ./src/styles/element-variables.scss

Syntax Error: Error: Missing binding /home/source/sixone-admin/node_modules/node-sass/vendor/linux-x64-83/binding.node
Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 14.x

Found bindings for the following environments:
  - Windows 64-bit with Node.js 14.x

This usually happens because your environment has changed since running `npm install`.
Run `npm rebuild node-sass` to download the binding for your current environment.


 @ ./src/styles/element-variables.scss 4:14-234 15:3-20:5 16:22-242
 @ ./src/main.js
 @ multi ./src/main.js
 ERROR  Build failed with errors.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build:stage: `vue-cli-service build --mode staging`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] build:stage script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2022-05-11T10_35_24_361Z-debug.log

二、解决方法

按提示执行以下命令:

npm rebuild node-sass

如果提示 stack Error: EACCES: permission denied, mkdir 错误,则执行命令:

npm rebuild node-sass --unsafe-perm

你可能感兴趣的:(常见问题解答(FAQ),npm,sass,vue.js)