Node Sass could not find a binding: nodesass问题处理记录

今天在新的开发环境检出nodejs的前端项目,运行npm start启动项目后报:

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

原因:升级了node版本,sass包和现在node版本不一致

处理:

npm uninstall node-sass
npm install node-sass

遂又遇到:

gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.

原因:缺少python环境

处理

第一种方式:
安装Python及环境变量配置
一定要安装python2.7的版本
环境变量安装可以参考:http://blog.csdn.net/lyj_viviani/article/details/51763101
如果第一种方式不行可以试试第二种方式。

第二种方式:
运行下面代码(以管理员身份运行cmd执行)
npm install --global --production windows-build-tools

遂遇到

Unexpected end of JSON input while parsing near **********

解决执行: `npm cache clean --force`

再次尝试,终于成功

最后再重新执行

npm uninstall node-sass
npm install node-sass

至此解决

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值