记录 npm install 报错-gyp ERR configure error

在尝试从gitlab克隆旧项目时遇到npm报错,错误显示为gyp找不到合适的Python环境。报错还指出node-sass与当前node版本不兼容,因为package.json中锁定了特定版本。为解决此问题,博主提供了两种方案:一是升级node-sass到与当前node版本兼容,二是回退到低版本的node。博主选择了降级node版本至14来解决冲突。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

今天从gitlab上clone下以前的项目npm报

gyp ERR! find Python
gyp ERR! find Python Python is not set from command line or npm configuration
gyp ERR! find Python Python is not set from environment variable PYTHON
gyp ERR! find Python checking if "python" can be used
gyp ERR! find Python - "python" is not in PATH or produced an error
gyp ERR! find Python checking if "python2" can be used
gyp ERR! find Python - "python2" is not in PATH or produced an error
gyp ERR! find Python checking if "python3" can be used
gyp ERR! find Python - "python3" is not in PATH or produced an error
gyp ERR! find Python checking if the py launcher can be used to find Python 2
gyp ERR! find Python - "py.exe" is not in PATH or produced an error
gyp ERR! find Python checking if Python is C:\Python27\python.exe
gyp ERR! find Python - "C:\Python27\python.exe" could not be run
gyp ERR! find Python checking if Python is C:\Python37\python.exe
gyp ERR! find Python - "C:\Python37\python.exe" could not be run

往下翻会看到有报node-sass不兼容当前node版本的提示信息,这是由于package.json中锁定了node-sass版本,解决办法有啷个
一:升级node-sass版本与当前node版本兼容
二:重新安装较低版本的node
由于我的node是16 ,我直接下载14

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值