npm - “Can't find Python executable ”python“, you can set the PYTHON env variable.”

后端 未结 8 1789
夕颜
夕颜 2021-02-02 07:04

I\'m trying to run the following command: npm install -g bower gulp cordova ionic tsd@next karma-cli protractor node-gyp coffee-script js-beautify typescript npm-check

相关标签:
8条回答
  • 2021-02-02 07:07

    I installed python2.7 to solve this issue. I wish can help you.

    0 讨论(0)
  • 2021-02-02 07:17

    Just run below command with admin access

    npm install --global --production windows-build-tools

    0 讨论(0)
  • 2021-02-02 07:18

    Try:

    Install all the required tools and configurations using Microsoft's windows-build-tools by running npm install -g windows-build-tools from an elevated PowerShell (run as Administrator).

    https://github.com/Microsoft/nodejs-guidelines/blob/master/windows-environment.md#environment-setup-and-configuration

    0 讨论(0)
  • 2021-02-02 07:22

    You are running the Command Prompt as an admin. You have only defined PYTHON for your user. You need to define it in the bottom "System variables" section.

    Also, you should only point the variable to the folder, not directly to the executable.

    0 讨论(0)
  • 2021-02-02 07:25

    The easiest way is to let NPM do everything for you,

    npm --add-python-to-path='true' --debug install --global windows-build-tools
    
    0 讨论(0)
  • 2021-02-02 07:28

    https://github.com/nodejs/node-gyp#on-windows

    https://github.com/Microsoft/nodejs-guidelines/blob/master/windows-environment.md#environment-setup-and-configuration

    try

    npm config set python D:\Library\Python\Python27\python.exe
    
    0 讨论(0)
提交回复
热议问题