在ionic 项目执行 npm i 命令时,出现Error: not found: python2的错误,错误如下图解决方案1、下载python https://www.python.org/download/releases/2.7/2、安装python3、设置python环境变量1)电脑右击——属性——高级系统设置—高级—环境变量2)系统变量—Path 中添加环境变量 C:\Python27(python安装目录)4、然后执行 npm ...
因为node-sass安装后会自动执行node-sass/script下的 build.js ,导致运行错误。
(在网上找了一大堆文章都是复制粘贴的,根本就没人去分析为什么报错,换淘宝镜像就OK了?为什么要换?)
不需要安装
Python
!
不一定需要从淘宝镜像安装!(因为有些时候,我们不允许更改镜像)
在
npm
安装时,不执行构建脚本即可:
npm
i --ignore-scripts
如果只是单独安装node - sass :
npm
i node-sass --ignore-scri
gyp info using node-gyp@3.8.0
gyp info using node@14.8.0 | win32 | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing
gyp verb check
python
checking for
Python
executable "
python
2" in the PATH
gyp verb `which` failed
Error
: not found:
python
2
gyp verb `which` failed at getNotFoundEr...
用管理员身份运行cmd,并输入:
npm
install
-g mirror-config-china --registry=http://registry.
npm
.taobao.org
npm
install
node-sass
如何用管理员身份运行cmd:
运行效果:
错误信息:
gyp verb command configure []
gyp verb check
python
checking for
Python
executable "
python
2" in t
lrwxrwxrwx 1 root root 9 3月 16 09:09 /usr/bin/
python
3 ->
python
3.6
-rwxr-xr-x 1 root root 4526456 11月 7 18:44 /usr/bin/
python
3.6
-rwxr-xr-x 1 root root 45...
error
E:\work\mbd-dp-dev\node_modules\node-sass: Command failed.
Exit code: 1
Command: node scripts/build.js
Arguments:
Directory: E:\work\mbd-dp-dev\node_modules\node-sass
Output:
Building: D:\Soft\code\ENV\node\node.exe E:\work\mbd-dp-dev\node_modules\n.
npm
install
时出现
Error
: not found:
python
2
npm
un
install
node-sass
npm
i node-sass --sass_binary_site=https://
npm
.taobao.org/mirrors/node-sass/
使用
npm
命令下载sass时出现
Error
: not found:
python
2
Module build failed:
Error
: Node Sass version 6.0.0 is incompatible with
3.设置
npm
时候使用的
python
npm
config set
python
python
2.7
4.设置vs路径??
npm
config set msvs_version 2017
5.
npm
--add-
python
-to-path='true' --debug
install
--global windows-build-tools
转自https://github.com/nodejs/node-gyp#on-windows
ionic ValidationError: Invalid options object. Sass Loader has been initialized using an options obj
16832