gpt4 book ai didi

javascript - 运行 npm install brain.js 时出现奇怪的 npm 错误

转载 作者:行者123 更新时间:2023-11-29 22:50:58 25 4
gpt4 key购买 nike

当尝试安装 brain.js 时,出现了一个奇怪的错误,我不明白问题出在哪里,python 在哪里进来,因为这是通过 安装库>npm。我在 Google 中没有找到类似的情况(我什至不明白如何用 google 搜索这个)。

G:\firststep\BR>npm i brain.js

> gl@4.3.3 install G:\firststep\BR\node_modules\gl
> prebuild-install || node-gyp rebuild

prebuild-install WARN install No prebuilt binaries found (target=10.14.2 runtime=node arch=x64 libc= platform=win32)

G:\firststep\BR\node_modules\gl>if not defined npm_config_node_gyp (node "C:\Users\rafae\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Users\rafae\AppData\Roaming
\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
gyp ERR! find Python
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 "python" can be used
gyp ERR! find Python - "python" is not in PATH or produced an error
gyp ERR! find Python checking if "python2" can be used
gyp ERR! find Python - "python2" is not in PATH or produced an error
gyp ERR! find Python checking if the py launcher can be used to find Python 2
gyp ERR! find Python - "py.exe" is not in PATH or produced an error
gyp ERR! find Python checking if Python is C:\Python27\python.exe
gyp ERR! find Python - "C:\Python27\python.exe" could not be run
gyp ERR! find Python checking if Python is C:\Python37\python.exe
gyp ERR! find Python - "C:\Python37\python.exe" could not be run
gyp ERR! find Python
gyp ERR! find Python **********************************************************
gyp ERR! find Python You need to install the latest version of Python 2.7.
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="C:\Path\To\python.exe"
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 "C:\Path\To\python.exe"
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 (C:\Users\rafae\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-python.js:303:47)
gyp ERR! stack at PythonFinder.runChecks (C:\Users\rafae\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-python.js:132:21)
gyp ERR! stack at PythonFinder.<anonymous> (C:\Users\rafae\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-python.js:221:16)
gyp ERR! stack at PythonFinder.execFileCallback (C:\Users\rafae\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-python.js:267:16)
gyp ERR! stack at exithandler (child_process.js:301:5)
gyp ERR! stack at ChildProcess.errorhandler (child_process.js:313:5)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:238:12)
gyp ERR! stack at onErrorNT (internal/child_process.js:407:16)
gyp ERR! stack at process._tickCallback (internal/process/next_tick.js:63:19)
gyp ERR! System Windows_NT 10.0.17763
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\rafae\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd G:\firststep\BR\node_modules\gl
gyp ERR! node -v v10.14.2
gyp ERR! node-gyp -v v5.0.3
gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open 'G:\firststep\BR\package.json'
npm WARN BR No description
npm WARN BR No repository field.
npm WARN BR No README data
npm WARN BR No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! gl@4.3.3 install: `prebuild-install || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the gl@4.3.3 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\rafae\AppData\Roaming\npm-cache\_logs\2019-08-14T18_48_29_640Z-debug.log

brain.js 的文档中没有提到这个问题。那里的一切都很简单 - 运行 npm install brain.js 就是这样。

2019 年 8 月 16 日更新

这条标记为选项 2 的说明帮助了我 https://github.com/nodejs/node-gyp#on-windows

最佳答案

确保为安装的 Python 设置了 Path 和 Env 变量。另外,我发现了类似的东西 here ..希望对您有所帮助!!

关于javascript - 运行 npm install brain.js 时出现奇怪的 npm 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57500514/

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