Error: Can’t find Python executable “Python “, you Can set the Python env variable

Error cause: Node.js failed to install module because python environment is missing.

  • Solution 1
    • Install Python version 2.7 and environment variable configuration
    1. Go to the Python official website and click on the right part of the “Downloads” drop-down list to download it. You are advised to download Python 2.7 for compatibility.
    2. Click on the system version you want to download

3. Click to download version 2.7

4. According to my own system download, mine is Windows 64-bit

5. Install the downloaded installation package and perform the default operations. 6

Right-click the desktop “the computer” – > “properties” – > “advanced system Settings” – > “environment variables” and the bottom right hand corner – > double click “system variables” in the “Path” – > click on the “new” – > enter just the installation position of the “C: \ Python27;” , get the result after the new, and then step by step to confirm back.

NPM install should be ok now, but there is an error as shown in the following figure:

Error: Node-gyp rebuild error: Node-gyp rebuild error: Node-gyp rebuild

  1. Download and install Microsoft Visual C++ Build Tools 2015
  2. performnpm config set msvs_version 2015 --global

Magic’s solution

To delete a node_modules and NPM install, found or complains, # error MSB4019: not found import project “C: \ Microsoft. Cpp. Default. Props”, attitude is a little up. After searching the web for this bug, I switched node versions (currently 14.16.0). NPM install does not display this error when switching to earlier versions of Node 8.12.0, 10.0.0, 11.12.0, 12.12.0. However, I changed the two versions to 8.12.0 and 10.0.0 and they started normally. The technology is limited. I don’t know why they are related to the Node version. Remember to re-delete node_modules and NPM install every time you switch node versions

BTW

However, if I change to 8.12.0 and 10.0.0, the two versions will start normally. However, if I use the latest version of Node 14.16.0, I will download the dependencies without any error, so I can run normally

  • Solution 2
    • To install Windows -build-tools, you need to start the command line as an administrator
    npm install --global windows-build-tools
    Copy the code

This command automatically downloads Visual C++ Build Tools and installs Python 2.7. website

  • Installation node – gyp
```js
npm install --global node-gyp
```
Copy the code
The first solution is recommended. If you install Windows build-tools, you may not be able to use Python globally. The second solution is also tried, but pythone cannot be used globally

NVM installation can be seen in my other article: NVM Installation