是否可以在环境变量中没有Python路径的情况下运行npm install

时间:2017-08-09 11:16:17

标签: node.js windows cmd npm npm-install

我正在尝试通过npm安装@ angular-cli。

我收到以下错误。

gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2

我猜,路径中不存在python。但我没有管理员帐户,无法对环境变量进行更改。

运行 npm install 时,通过提及python路径,有没有办法运行 npm install -g @ angular / cli

1 个答案:

答案 0 :(得分:1)

您可以将以前npm的'python'配置键设置为适当的值:

$ npm config set python /path/to/executable/python2.7