繁体   English   中英

npm 错误! 代码 1 无法安装 nodemodule

[英]npm ERR! code 1 cannot install nodemodule

npm ERR! code 1
npm ERR! path D:\Neneng\a) Neneng_Pribadi File\2] Raynar abiyu diera\Rays DEV\Atomic BOT\node_modules\canvas
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c C:\Users\user\AppData\Local\Temp\install-d7cdc73b.cmd
npm ERR! Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\user\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --update-binary --module=D:\Neneng\a) Neneng_Pribadi File\2] Raynar abiyu diera\Rays DEV\Atomic BOT\node_modules\canvas\build\Release\canvas.node --module_name=canvas --module_path=D:\Neneng\a) Neneng_Pribadi File\2] Raynar abiyu diera\Rays DEV\Atomic BOT\node_modules\canvas\build\Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108' (1)
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using node-pre-gyp@1.0.9
npm ERR! node-pre-gyp info using node@18.10.0 | win32 | x64
npm ERR! node-pre-gyp http GET https://github.com/Automattic/node-canvas/releases/download/v2.9.3/canvas-v2.9.3-node-v108-win32-unknown-x64.tar.gz
npm ERR! node-pre-gyp ERR! install request to https://github.com/Automattic/node-canvas/releases/download/v2.9.3/canvas-v2.9.3-node-v108-win32-unknown-x64.tar.gz failed, reason: getaddrinfo ENOTFOUND github.com
npm ERR! node-pre-gyp WARN Pre-built binaries not installable for canvas@2.9.3 and node@18.10.0 (node-v108 ABI, unknown) (falling back to source compile with node-gyp)
npm ERR! node-pre-gyp WARN Hit error request to https://github.com/Automattic/node-canvas/releases/download/v2.9.3/canvas-v2.9.3-node-v108-win32-unknown-x64.tar.gz failed, reason: getaddrinfo ENOTFOUND github.com
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.0.0
npm ERR! gyp info using node@18.10.0 | win32 | x64
npm ERR! gyp info ok
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.0.0
npm ERR! gyp info using node@18.10.0 | win32 | x64
npm ERR! gyp info find Python using Python version 3.10.6 found at "C:\Users\user\AppData\Local\Programs\Python\Python310\python.exe"     
npm ERR! gyp http GET https://nodejs.org/download/release/v18.10.0/node-v18.10.0-headers.tar.gz
npm ERR! gyp WARN install got an error, rolling back install
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: This is most likely not a problem with node-gyp or the package itself and
npm ERR! gyp ERR! stack is related to network connectivity. In most cases you are behind a proxy or have bad
npm ERR! gyp ERR! stack network settings.
npm ERR! gyp ERR! stack     at go (C:\Users\user\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\install.js:173:17)        
npm ERR! gyp ERR! stack     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
npm ERR! gyp ERR! stack     at async install (C:\Users\user\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\install.js:87:16)
npm ERR! gyp ERR! System Windows_NT 10.0.22000
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\user\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--update-binary" "--module=D:\\Neneng\\a) Neneng_Pribadi File\\2] Raynar abiyu diera\\Rays DEV\\Atomic BOT\\node_modules\\canvas\\build\\Release\\canvas.node" "--module_name=canvas" "--module_path=D:\\Neneng\\a) Neneng_Pribadi File\\2] Raynar abiyu diera\\Rays DEV\\Atomic BOT\\node_modules\\canvas\\build\\Release" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v108"
npm ERR! gyp ERR! cwd D:\Neneng\a) Neneng_Pribadi File\2] Raynar abiyu diera\Rays DEV\Atomic BOT\node_modules\canvas
npm ERR! gyp ERR! node -v v18.10.0
npm ERR! gyp ERR! node-gyp -v v9.0.0
npm ERR! gyp ERR! not ok
npm ERR! node-pre-gyp ERR! build error
npm ERR! node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\user\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --update-binary --module=D:\Neneng\a) Neneng_Pribadi File\2] Raynar abiyu diera\Rays DEV\Atomic BOT\node_modules\canvas\build\Release\canvas.node --module_name=canvas --module_path=D:\Neneng\a) Neneng_Pribadi File\2] Raynar abiyu diera\Rays DEV\Atomic BOT\node_modules\canvas\build\Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108' (1)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (D:\Neneng\a) Neneng_Pribadi File\2] Raynar abiyu diera\Rays DEV\Atomic BOT\node_modules\@mapbox\node-pre-gyp\lib\util\compile.js:89:23)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
npm ERR! node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1091:16)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:302:5)
npm ERR! node-pre-gyp ERR! System Windows_NT 10.0.22000
npm ERR! node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "D:\\Neneng\\a) Neneng_Pribadi File\\2] Raynar abiyu diera\\Rays DEV\\Atomic BOT\\node_modules\\@mapbox\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build" "--update-binary"
npm ERR! node-pre-gyp ERR! cwd D:\Neneng\a) Neneng_Pribadi File\2] Raynar abiyu diera\Rays DEV\Atomic BOT\node_modules\canvas
npm ERR! node-pre-gyp ERR! node -v v18.10.0
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v1.0.9
npm ERR! node-pre-gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\user\AppData\Local\npm-cache\_logs\2022-09-30T11_42_19_512Z-debug-0.log 

那里的关键错误是:

ERR: install request to https.//github.com/Automattic/node-canvas/releases/download/v2.9.3/canvas-v2.9.3-node-v108-win32-unknown-x64.tar,gz failed: reason. getaddrinfo ENOTFOUND github.com

如果我们 go 到那个 repo:
https://github.com/Automattic/node-canvas/releases/tag/v2.9.3

那里没有node-v108


已经有人请求了,并且有一个解决方法:
https://github.com/Automattic/node-canvas/issues/2025#issuecomment-1112543373

每个操作系统因不同原因而失败。 这将需要一段时间来修复疲倦。 同时请按照 README 获取有关从源代码构建的说明。 https://github.com/Automattic/node-canvas#compiling


https://github.com/Automattic/node-canvas/issues/2052#issuecomment-1157912610

我们还没有适用于 Node 18 的预构建,不幸的是,要制作它们还需要做很多事情,请参阅#2025( https://github.com/Automattic/node-canvas/issues/2025 )。 在此之前,必须从https://github.com/Automattic/node-canvas#compiling之后的源代码构建此模块。 如果您在编译时遇到问题,请打开一个单独的问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM