2

npm install报错not found: python2的结局方法

 2 years ago
source link: https://segmentfault.com/a/1190000041588011
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

npm install报错not found: python2的结局方法

这个问题,困扰过几乎所有的前端开发人员,我自己每次换电脑也对这个很头疼。干脆重新整理记录一下。

  1. 安装指定版本的python
    下载地址:https://www.python.org/downlo...
  2. 安装Visual C++(需要先安装Visual Studio)
    下载地址:https://visualstudio.microsof...
    在Visual Studio选择桌面开发C++运行库,进行安装
    image.png
  3. 配置python环境变量
    在Path中添加: C:/Python2.7
  4. 打开cmd,配置Visual Studio版本和python版本

     npm config set msvs_version 2022
     npm config set python python2.7

经过以上4步,就基本上完成了所有的安装和配置。接下来就可以成功安装node-gyp等以来nodejs库了


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK