首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >我不能用npm安装引擎。

我不能用npm安装引擎。
EN

Stack Overflow用户
提问于 2022-06-21 13:08:12
回答 1查看 169关注 0票数 0

我试过用npm安装react引擎,但是它会抛出错误。

我想安装python是很有意义的,但有必要吗?

代码语言:javascript
运行
复制
bufferutil@4.0.6 install                            > node-gyp-build

gyp info it worked if it ends with ok timing reifyNod gyp info using node-gyp@9.0.0                         gyp info using node@18.2.0 | android | arm64
gyp ERR! find Python \ reify:es5-ext: timing reifyNod
gyp ERR! find Python Python is not set from command line or npm configuration
gyp ERR! find Python Python is not set from environment variable PYTHON                                     gyp ERR! find Python checking if "python3" can be usedgyp ERR! find Python - "python3" is not in PATH or produced an error
gyp ERR! find Python checking if "python" can be used
gyp ERR! find Python - "python" is not in PATH or produced an error
gyp ERR! find Python
gyp ERR! find Python **********************************************************
gyp ERR! find Python You need to install the latest version of Python.
gyp ERR! find Python Node-gyp should be able to find and use Python. If not,                                gyp ERR! find Python you can try one of the following options:
gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"
gyp ERR! find Python   (accepted by both node-gyp and npm)
gyp ERR! find Python - Set the environment variable PYTHON
gyp ERR! find Python - Set the npm configuration variable python:
gyp ERR! find Python   npm config set python "/path/to/pythonexecutable"
gyp ERR! find Python For more information consult the documentation at:
gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
gyp ERR! find Python **********************************************************
gyp ERR! find Python
gyp ERR! configure error
gyp ERR! stack Error: Could not find any Python installation to use
gyp ERR! stack     at PythonFinder.fail (/data/data/com.termux/files/usr/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:330:47)
gyp ERR! stack     at PythonFinder.runChecks (/data/data/com.termux/files/usr/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:159:21)
gyp ERR! stack     at PythonFinder.<anonymous> (/data/data/com.termux/files/usr/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:202:16)
gyp ERR! stack     at PythonFinder.execFileCallback (/data/data/com.termux/files/usr/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:294:16)
gyp ERR! stack     at exithandler (node:child_process:395:5)
gyp ERR! stack     at ChildProcess.errorhandler (node:child_process:407:5)
gyp ERR! stack     at ChildProcess.emit (node:events:527:28)
gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:289:12)
gyp ERR! stack     at onErrorNT (node:internal/child_process:476:16)
gyp ERR! stack     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
gyp ERR! System Linux 4.9.112-perf+
gyp ERR! command "/data/data/com.termux/files/usr/bin/node" "/data/data/com.termux/files/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /data/data/com.termux/files/home/chat_app/node_modules/bufferutil
gyp ERR! node -v v18.2.0
gyp ERR! node-gyp -v v9.0.0
gyp ERR! not ok[##################] \ reify:es5-ext: t ming reifyNod
npm ERR! code 1
npm ERR! path /data/data/com.termux/files/home/chat_app/node_modules/bufferutil
npm ERR! command failed
npm ERR! command sh -c node-gyp-build

npm ERR! A complete log of this run can be found in:
npm ERR!     /data/data/com.termux/files/home/.npm/_logs/2022-06-21T12_02_29_354Z-debug-0.log

是否有orI需要安装python

的解决方案?

EN

回答 1

Stack Overflow用户

发布于 2022-06-21 13:31:01

如果npm包或即将安装的任何依赖项包含需要编译的“本机代码”(例如c/c++代码),则npm使用用Python编写的node-gyp工具。因此,您需要安装python。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72701374

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档