1、-element\node_modules\node-sass\vendor\win32-x64-72\binding.node

Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 12.x

解决办法:

1、删除 node_modules
2、cnpm install -g node-gyp
3、cnpm install –global –production windows-build-tools
4、cnpm i
5、npm rebuild node-sass

  • 2、创建Vue项目出错,提示vue : 无法加载文件C:\Users\xxx\AppData\Roaming\npm\vue.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.microsoft.com/fwlink/?LinkID=135170
1. 以管理员身份运行PowerShell
2. 执行:get-ExecutionPolicy,回复Restricted,表示状态是禁止的
3.执行:set-ExecutionPolicy RemoteSigned
4.选择Y

注意:一定要以管理员的身份运行PowerShell,不是cmd窗口!

2、输入npm install 报错npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! sass@4.13.1"">node-sass@4.13.1 postinstall: node scripts/build.js

输入npm install

报以下错误

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.13.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.13.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

这个是因为sass安装时获取源的问题,修改sass安装的源,使用taobao的npm

npm config set sass_binary_site=https://npm.taobao.org/mirrors/node-sass

然后运行

npm install

3、Module build failed: Error: Node Sass does not yet support your current environment: 解决办法

Module build failed: Error: Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (93)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v4.14.1

注意编译报错内容提示,当前的node-sass是不被支持的,

再查看错误日志中的一行:https://github.com/sass/node-sass/releases/tag/v4.14.1 ,如下图:

从项目文档说明可知,目前Node-sass支持的最高node版本为 14, 下载 14 版本,

https://nodejs.org/zh-cn/download/releases/

最终找到问题的所在了,是因为系统的Node版本过高导致的编译异常,只需要将版本降低到14,在重新build一下node-sass就可以了,输入指令:npm rebuild node-sass 即可

作者:Jeebiz  创建时间:2023-02-25 00:50
最后编辑:Jeebiz  更新时间:2024-02-28 14:53