15年软件开发经验 只做源码定制 互联网+定制化解决方案

15年软件开发经验,只做源码定制!

原创设计 定制开发

满足您的个性化需求

当前位置:首页 后端开发 Nodejs

安装node-sass报错解决方案(缺少python2.7支持)

庞凯博| 发布于 2021-10-21 22:43:52| 513阅读| 0点赞| 0评论
举报

Node.js 在安装模块的时候报错,缺少python环境。 ERR! configure error gyp ERR! stack Error: Can't find Python executable

Node.js 在安装模块的时候报错,缺少python环境。

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

D:\node_modules\selenium-webdriver\node_modules\ws\node_modules\utf-8-validate>node "D:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild

ERR! configure error

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

gyp ERR! stack     at failNoPython (D:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:103:14)

gyp ERR! stack     at D:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:64:11

gyp ERR! stack     at Object.oncomplete (fs.js:107:15)

gyp ERR! System Windows_NT 6.2.9200

gyp ERR! command "node" "D:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"

gyp ERR! cwd D:\node_modules\selenium-webdriver\node_modules\ws\node_modules\utf-8-validate

gyp ERR! node -v v0.10.29

gyp ERR! node-gyp -v v0.13.1

gyp ERR! not ok

原因看node-gyp的安装需求,https://github.com/nodejs/node-gyp, 部分剪切如下,可以请求的看到需要安装python2.7(其实2.6也行)python3不行

1.先删除node_modules 文件夹。
2.npm install --global windows-build-tools 
3. npm install node-sass --save

0

0条评论

别默默看啦~登录/注册一起参与讨论吧~

热门标签

庞凯博
微信扫一扫立即咨询
账号登录|扫码登录

立即注册 |忘记密码?

欢迎注册

已有账号马上登录

重置密码

扫码绑定微信
微信扫一扫

绑定手机号

分享到-微信

举报

  • 举报类型:

  • 举报描述:

您好,当前积分不足。

在线客服
拨打电话
17330196230 13230981129
顶部