<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[Heck's  Blog]]></title> 
<link>https://www.heckjj.com/index.php</link> 
<description><![CDATA[一瞬间的决定，往往可以改变很多，事实上，让自己成功的往往不是知识，是精神！ 如果你总是为自己找借口，那只好让成功推迟。执行力，今天！]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[Heck's  Blog]]></copyright>
<item>
<link>https://www.heckjj.com/post//</link>
<title><![CDATA[运行npm install报错Python is not set from command line or npm configuration，查询不到python]]></title> 
<author>Heck &lt;@hecks.tk&gt;</author>
<category><![CDATA[Web开发]]></category>
<pubDate>Thu, 16 Jun 2022 08:43:05 +0000</pubDate> 
<guid>https://www.heckjj.com/post//</guid> 
<description>
<![CDATA[ 
	gyp ERR! find Python<br/>gyp ERR! find Python Python is not set from command line or npm configuration<br/>gyp ERR! find Python Python is not set from environment variable PYTHON<br/>gyp ERR! find Python checking if &quot;python3&quot; can be used<br/>gyp ERR! find Python - &quot;python3&quot; is not in PATH or produced an error<br/>gyp ERR! find Python checking if &quot;python&quot; can be used<br/>gyp ERR! find Python - &quot;python&quot; is not in PATH or produced an error<br/>gyp ERR! find Python checking if Python is C:&#92;Users&#92;Heck&#92;AppData&#92;Local&#92;Programs&#92;Python&#92;Python39&#92;python.exe<br/>gyp ERR! find Python - &quot;C:&#92;Users&#92;Heck&#92;AppData&#92;Local&#92;Programs&#92;Python&#92;Python39&#92;python.exe&quot; could not be run<br/>gyp ERR! find Python checking if Python is C:&#92;Program Files&#92;Python39&#92;python.exe<br/>gyp ERR! find Python - &quot;C:&#92;Program Files&#92;Python39&#92;python.exe&quot; could not be run<br/>gyp ERR! find Python checking if Python is C:&#92;Users&#92;Heck&#92;AppData&#92;Local&#92;Programs&#92;Python&#92;Python39-32&#92;python.exe<br/>gyp ERR! find Python - &quot;C:&#92;Users&#92;Heck&#92;AppData&#92;Local&#92;Programs&#92;Python&#92;Python39-32&#92;python.exe&quot; could not be run<br/>gyp ERR! find Python checking if Python is C:&#92;Program Files&#92;Python39-32&#92;python.exe<br/>gyp ERR! find Python - &quot;C:&#92;Program Files&#92;Python39-32&#92;python.exe&quot; could not be run<br/>gyp ERR! find Python checking if Python is C:&#92;Program Files (x86)&#92;Python39-32&#92;python.exe<br/>gyp ERR! find Python - &quot;C:&#92;Program Files (x86)&#92;Python39-32&#92;python.exe&quot; could not be run<br/>gyp ERR! find Python checking if Python is C:&#92;Users&#92;Heck&#92;AppData&#92;Local&#92;Programs&#92;Python&#92;Python38&#92;python.exe<br/>gyp ERR! find Python - &quot;C:&#92;Users&#92;Heck&#92;AppData&#92;Local&#92;Programs&#92;Python&#92;Python38&#92;python.exe&quot; could not be run<br/>gyp ERR! find Python checking if Python is C:&#92;Program Files&#92;Python38&#92;python.exe<br/>gyp ERR! find Python - &quot;C:&#92;Program Files&#92;Python38&#92;python.exe&quot; could not be run<br/>gyp ERR! find Python checking if Python is C:&#92;Users&#92;Heck&#92;AppData&#92;Local&#92;Programs&#92;Python&#92;Python38-32&#92;python.exe<br/>gyp ERR! find Python - &quot;C:&#92;Users&#92;Heck&#92;AppData&#92;Local&#92;Programs&#92;Python&#92;Python38-32&#92;python.exe&quot; could not be run<br/>gyp ERR! find Python checking if Python is C:&#92;Program Files&#92;Python38-32&#92;python.exe<br/>gyp ERR! find Python - &quot;C:&#92;Program Files&#92;Python38-32&#92;python.exe&quot; could not be run<br/>gyp ERR! find Python checking if Python is C:&#92;Program Files (x86)&#92;Python38-32&#92;python.exe<br/>gyp ERR! find Python - &quot;C:&#92;Program Files (x86)&#92;Python38-32&#92;python.exe&quot; could not be run<br/>gyp ERR! find Python checking if Python is C:&#92;Users&#92;Heck&#92;AppData&#92;Local&#92;Programs&#92;Python&#92;Python37&#92;python.exe<br/>gyp ERR! find Python - &quot;C:&#92;Users&#92;Heck&#92;AppData&#92;Local&#92;Programs&#92;Python&#92;Python37&#92;python.exe&quot; could not be run<br/>gyp ERR! find Python checking if Python is C:&#92;Program Files&#92;Python37&#92;python.exe<br/>gyp ERR! find Python - &quot;C:&#92;Program Files&#92;Python37&#92;python.exe&quot; could not be run<br/>gyp ERR! find Python checking if Python is C:&#92;Users&#92;Heck&#92;AppData&#92;Local&#92;Programs&#92;Python&#92;Python37-32&#92;python.exe<br/>gyp ERR! find Python - &quot;C:&#92;Users&#92;Heck&#92;AppData&#92;Local&#92;Programs&#92;Python&#92;Python37-32&#92;python.exe&quot; could not be run<br/>gyp ERR! find Python checking if Python is C:&#92;Program Files&#92;Python37-32&#92;python.exe<br/>gyp ERR! find Python - &quot;C:&#92;Program Files&#92;Python37-32&#92;python.exe&quot; could not be run<br/>gyp ERR! find Python checking if Python is C:&#92;Program Files (x86)&#92;Python37-32&#92;python.exe<br/>gyp ERR! find Python - &quot;C:&#92;Program Files (x86)&#92;Python37-32&#92;python.exe&quot; could not be run<br/>gyp ERR! find Python checking if Python is C:&#92;Users&#92;Heck&#92;AppData&#92;Local&#92;Programs&#92;Python&#92;Python36&#92;python.exe<br/>gyp ERR! find Python - &quot;C:&#92;Users&#92;Heck&#92;AppData&#92;Local&#92;Programs&#92;Python&#92;Python36&#92;python.exe&quot; could not be run<br/>gyp ERR! find Python checking if Python is C:&#92;Program Files&#92;Python36&#92;python.exe<br/>gyp ERR! find Python - &quot;C:&#92;Program Files&#92;Python36&#92;python.exe&quot; could not be run<br/>gyp ERR! find Python checking if Python is C:&#92;Users&#92;Heck&#92;AppData&#92;Local&#92;Programs&#92;Python&#92;Python36-32&#92;python.exe<br/>gyp ERR! find Python - &quot;C:&#92;Users&#92;Heck&#92;AppData&#92;Local&#92;Programs&#92;Python&#92;Python36-32&#92;python.exe&quot; could not be run<br/>gyp ERR! find Python checking if Python is C:&#92;Program Files&#92;Python36-32&#92;python.exe<br/>gyp ERR! find Python - &quot;C:&#92;Program Files&#92;Python36-32&#92;python.exe&quot; could not be run<br/>gyp ERR! find Python checking if Python is C:&#92;Program Files (x86)&#92;Python36-32&#92;python.exe<br/>gyp ERR! find Python - &quot;C:&#92;Program Files (x86)&#92;Python36-32&#92;python.exe&quot; could not be run<br/>gyp ERR! find Python checking if the py launcher can be used to find Python 3<br/>gyp ERR! find Python - &quot;py.exe&quot; is not in PATH or produced an error<br/>gyp ERR! find Python<br/>gyp ERR! find Python **********************************************************<br/>gyp ERR! find Python You need to install the latest version of Python.<br/>gyp ERR! find Python Node-gyp should be able to find and use Python. If not,<br/>gyp ERR! find Python you can try one of the following options:<br/>gyp ERR! find Python - Use the switch --python=&quot;C:&#92;Path&#92;To&#92;python.exe&quot;<br/>gyp ERR! find Python&nbsp;&nbsp; (accepted by both node-gyp and npm)<br/>gyp ERR! find Python - Set the environment variable PYTHON<br/>gyp ERR! find Python - Set the npm configuration variable python:<br/>gyp ERR! find Python&nbsp;&nbsp; npm config set python &quot;C:&#92;Path&#92;To&#92;python.exe&quot;<br/>gyp ERR! find Python For more information consult the documentation at:<br/>gyp ERR! find Python https://github.com/nodejs/node-gyp#installation<br/>gyp ERR! find Python **********************************************************<br/>gyp ERR! find Python<br/>gyp ERR! configure error<br/>gyp ERR! stack Error: Could not find any Python installation to use<br/>gyp ERR! stack&nbsp;&nbsp;&nbsp;&nbsp; at PythonFinder.fail (D:&#92;ITL&#92;source&#92;wechat&#92;node_modules&#92;node-gyp&#92;lib&#92;find-python.js:330:47)<br/>gyp ERR! stack&nbsp;&nbsp;&nbsp;&nbsp; at PythonFinder.runChecks (D:&#92;ITL&#92;source&#92;wechat&#92;node_modules&#92;node-gyp&#92;lib&#92;find-python.js:159:21)<br/>gyp ERR! stack&nbsp;&nbsp;&nbsp;&nbsp; at PythonFinder.&lt;anonymous&gt; (D:&#92;ITL&#92;source&#92;wechat&#92;node_modules&#92;node-gyp&#92;lib&#92;find-python.js:228:18)<br/>gyp ERR! stack&nbsp;&nbsp;&nbsp;&nbsp; at PythonFinder.execFileCallback (D:&#92;ITL&#92;source&#92;wechat&#92;node_modules&#92;node-gyp&#92;lib&#92;find-python.js:294:16)<br/>gyp ERR! stack&nbsp;&nbsp;&nbsp;&nbsp; at exithandler (child_process.js:296:5)<br/>gyp ERR! stack&nbsp;&nbsp;&nbsp;&nbsp; at ChildProcess.errorhandler (child_process.js:308:5)<br/>gyp ERR! stack&nbsp;&nbsp;&nbsp;&nbsp; at ChildProcess.emit (events.js:182:13)<br/>gyp ERR! stack&nbsp;&nbsp;&nbsp;&nbsp; at Process.ChildProcess._handle.onexit (internal/child_process.js:238:12)<br/>gyp ERR! stack&nbsp;&nbsp;&nbsp;&nbsp; at onErrorNT (internal/child_process.js:407:16)<br/>gyp ERR! stack&nbsp;&nbsp;&nbsp;&nbsp; at process._tickCallback (internal/process/next_tick.js:63:19)<br/>gyp ERR! System Windows_NT 10.0.10586<br/><br/>解决方案：<br/>1. 管理员权限打开cmd，在项目目录下执行：npm install --global --production windows-build-tools<br/><br/>安装成功会在C:&#92;Users&#92;**（电脑用户名）&nbsp;&nbsp;目录下创建.windows-build-tools文件夹<br/><br/>2. 必须配置环境变量，将C:&#92;Users&#92;**&#92;.windows-build-tools&#92;python27地址添加到path中<br/><br/>3. 重启VSCode或者cmd窗口，我当时打开了2个VSCode窗口，只重启了一个，结果环境变量地址没有生效，又折腾了好久，一定要把所有VSCode窗口关闭重启。<br/><br/>也可以在python官网下载安装，还是要配置环境变量<br/><br/>在npm install安装期间，电脑又提示了安装.net framework4.8<br/>
]]>
</description>
</item><item>
<link>https://www.heckjj.com/post//#blogcomment</link>
<title><![CDATA[[评论] 运行npm install报错Python is not set from command line or npm configuration，查询不到python]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>https://www.heckjj.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>