gpt4 book ai didi

node.js - Npm 错误 : Can't find Python executable "python", 您可以在 Windows 10 上设置 PYTHON 环境变量

转载 作者:太空宇宙 更新时间:2023-11-04 01:24:46 25 4
gpt4 key购买 nike

我正在尝试在我的项目上运行 npm i 命令,但它显示错误找不到 python 可执行文件 python。你可以设置 python 环境变量。请任何人帮助我解决这一问题。非常感谢提前。

gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at PythonFinder.failNoPython (C:\node\node_modules\npm\node_modules\node-gyp\lib\configure.js:484:19)
gyp ERR! stack at PythonFinder.<anonymous> (C:\node\node_modules\npm\node_modules\node-gyp\lib\configure.js:509:16)
gyp ERR! stack at C:\node\node_modules\npm\node_modules\graceful-fs\polyfills.js:282:31
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:153:21)
gyp ERR! System Windows_NT 10.0.15063
gyp ERR! command "C:\\node\\node.exe" "C:\\node\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\\Users\\vks\\prok\\vk\\node_modules\\sqlite3\\lib\\binding\\node-v64-win32-x64\\node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=C:\\Users\\vks\\prok\\vk\\node_modules\\sqlite3\\lib\\binding\\node-v64-win32-x64" "--napi_version=4" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v64"
gyp ERR! cwd C:\Users\vk\prok\node_modules\sqlite3
gyp ERR! node -v v10.16.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'C:\node\node.exe C:\node\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\vks\prok\vk\node_modules\sqlite3\lib\binding\node-v64-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=C:\Users\vks\prok\vk\node_modules\sqlite3\lib\binding\node-v64-win32-x64 --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v64' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (C:\Users\vks\prok\vk\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:198:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:982:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
node-pre-gyp ERR! System Windows_NT 10.0.15063
node-pre-gyp ERR! command "C:\\node\\node.exe" "C:\\Users\\vks\\prok\\vk\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\Users\vks\prok\vk\node_modules\sqlite3
node-pre-gyp ERR! node -v v10.16.3
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! not ok
Failed to execute 'C:\node\node.exe C:\node\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\vks\prok\vk\node_modules\sqlite3\lib\binding\node-v64-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=C:\Users\vks\prok\vk\node_modules\sqlite3\lib\binding\node-v64-win32-x64 --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v64' (1)
npm WARN ajv-keywords@2.1.1 requires a peer of ajv@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN eic_api@1.11.0-0 No repository field.
npm WARN eic_api@1.11.0-0 No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sqlite3@4.1.0 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sqlite3@4.1.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\vk\AppData\Roaming\npm-cache\_logs\2019-09-16T05_11_44_737Z-debug.log

现在我的系统上出现此错误

1304 warn ajv-keywords@2.1.1 requires a peer of ajv@^5.0.0 but none is installed. You must install peer dependencies yourself.
1305 warn eic_api@1.13.0 No repository field.
1306 warn eic_api@1.13.0 No license field.
1307 warn optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents):
1308 warn notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
1309 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS: darwin
1309 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch: any
1309 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS: win32
1309 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
1310 verbose stack Error: sqlite3@4.1.0 install: `node-pre-gyp install --fallback-to-build`
1310 verbose stack Exit status 1
1310 verbose stack at EventEmitter.<anonymous> (C:\Users\\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
1310 verbose stack at EventEmitter.emit (events.js:159:13)
1310 verbose stack at ChildProcess.<anonymous> (C:\Users\\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
1310 verbose stack at ChildProcess.emit (events.js:159:13)
1310 verbose stack at maybeClose (internal/child_process.js:943:16)
1310 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
1311 verbose pkgid sqlite3@4.1.0
1312 verbose cwd C:\Users\test\
1313 verbose Windows_NT 10.0.15063
1314 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "--verbose"
1315 verbose node v9.3.0
1316 verbose npm v6.11.3
1317 error code ELIFECYCLE
1318 error errno 1
1319 error sqlite3@4.1.0 install: `node-pre-gyp install --fallback-to-build`
1319 error Exit status 1
1320 error Failed at the sqlite3@4.1.0 install script.
1320 error This is probably not a problem with npm. There is likely additional logging output above.
1321 verbose exit [ 1, true ]

我的系统上有 Node 版本 9.3.0 和 npm 版本 6.11.3

最佳答案

就我而言,问题是由于 Python 版本造成的。我使用的是 Python39,但我尝试安装的依赖项需要 Python27。当我安装 Python27 时,问题自动解决了。

关于node.js - Npm 错误 : Can't find Python executable "python", 您可以在 Windows 10 上设置 PYTHON 环境变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57950763/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com