2.安装python
推荐安装2.7版本(自行选择32位或者64位安装):
https://www.python.org/downlo...
如果官网下载速度很慢,可以使用另一种安装方式
以管理员身份执行
<pre class="hljs language-brainfuck" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 14px; margin-top: 0px !important; margin-bottom: 1.25rem; overflow: auto; display: block; color: rgb(36, 41, 46); background: rgb(233, 236, 239); padding: 1rem; max-height: 35rem; line-height: 1.5; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">npm install --global --production windows-build-tools</pre>
安装完成后会在C:WindowsSystem32里找到一个名为.windows-build-tools的文件夹
[图片上传失败...(image-c65bf3-1629706422666)]
可以直接按照这个目录配置环境,为了方便,我选择将python27重装到D盘,点击python-2.7.15.amd64.msi选择
移除之后再点击setup程序,这次可以直接安装
安装成功后,在命令行界面输入python测试是否安装成功
3.配置环境变量
环境变量->系统环境变量->Path
[图片上传失败...(image-353a1-1629706422666)]
4.npm 配置
<pre class="hljs language-swift" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 14px; margin-top: 0px !important; margin-bottom: 1.25rem; overflow: auto; display: block; color: rgb(36, 41, 46); background: rgb(233, 236, 239); padding: 1rem; max-height: 35rem; line-height: 1.5; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">npm config set python "D:\Python27\python.exe"
npm config set node_gyp "D:\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js"</pre>