vue 安装node-sass报错解决方案(缺少python2.7支持)
Node.js
在安装模块的时候报错,缺少python环境。 ERR! configure error gyp ERR! stack Error: Can't find Python executable
ERR! configure error gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
D:\node_modules\selenium-webdriver\node_modules\ws\node_modules\utf-8-validate>node "D:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at failNoPython (D:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:103:14)
gyp ERR! stack at D:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:64:11
gyp ERR! stack at Object.oncomplete (fs.js:107:15)
gyp ERR! System Windows_NT 6.2.9200
gyp ERR! command "node" "D:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\node_modules\selenium-webdriver\node_modules\ws\node_modules\utf-8-validate
gyp ERR! node -v v0.10.29
gyp ERR! node-gyp -v v0.13.1
gyp ERR! not ok
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
原因看node-gyp
的安装需求,https://github.com/nodejs/node-gyp (opens new window), 部分剪切如下,可以请求的看到需要安装python2.7(其实2.6也行)python3不行
- 先删除
node_modules
文件夹。
- 先删除
npm install --global windows-build-tools
npm install node-sass --save
上次更新: 2024/01/30, 00:35:17
- 01
- linux 在没有 sudo 权限下安装 Ollama 框架12-23
- 02
- Express 与 vue3 使用 sse 实现消息推送(长连接)12-20