npm install时报错:Error: Can‘t find Python executable “python“;和Cannot find module ‘node-sass‘
·
问题一 Can’t find Python executable “python”
最近在做项目时使用vscode导入前端项目,在进行 npm install 运行报错 Error: Can’t find Python executable “python”, you can set the PYTHON env variable
解决方法:
方法1:
1、 安装windows-build-tools
npm install --global --production windows-build-tools
安装就是安装 Python
2、安装node-gyp
npm install --global node-gyp
方法2:
自己可以在电脑上下载 Python,然后安装即可!
Python下载地址:https://www.python.org/ftp/python/3.7.6/
安装教程:https://blog.csdn.net/qq_42415326/article/details/89522254?spm=1001.2101.3001.6650.1&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-1.opensearchhbase&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-1.opensearchhbase
问题二 Cannot find module ‘node-sass’
在解决了上述 Python 问题, npm install 时还是报错:
解决方法
安装node-sass,不加版本号直接安装。
npm install node-sass
然后 npm insatll 就OK了。
更多推荐
所有评论(0)