node-libcurl icon indicating copy to clipboard operation
node-libcurl copied to clipboard

Cannot install

Open owendswang opened this issue 2 years ago • 2 comments

Describe the bug

cannot install

To Reproduce

npm install node-libcurl

Version information:

default latest

OS: Windows 11 Node.js Version: 20.11.0

Additional context Log:

npm WARN deprecated @npmcli/[email protected]: This functionality has been moved to @npmcli/fs
npm ERR! code 1
npm ERR! path M:\TDDOWNLOAD\weibo\server_js_backup\node_modules\node-libcurl
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node-pre-gyp install --fallback-to-build
npm ERR! Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\owend\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=M:\TDDOWNLOAD\weibo\server_js_backup\node_modules\node-libcurl\lib\binding\node_libcurl.node --module_name=node_libcurl --module_path=M:\TDDOWNLOAD\weibo\server_js_backup\node_modules\node-libcurl\lib\binding --napi_version=9 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v115' (1)
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using [email protected]
npm ERR! node-pre-gyp info using [email protected] | win32 | x64
npm ERR! node-pre-gyp info check checked for "M:\TDDOWNLOAD\weibo\server_js_backup\node_modules\node-libcurl\lib\binding\node_libcurl.node" (not found)
npm ERR! node-pre-gyp http GET https://github.com/JCMais/node-libcurl/releases/download/v3.0.0/node_libcurl-v3.0.0-node-v115-win32-x64-unknown.tar.gz
npm ERR! node-pre-gyp http download proxy agent configured using: "http://192.168.1.6:8118"
npm ERR! node-pre-gyp ERR! install response status 404 Not Found on https://github.com/JCMais/node-libcurl/releases/download/v3.0.0/node_libcurl-v3.0.0-node-v115-win32-x64-unknown.tar.gz
npm ERR! node-pre-gyp WARN Pre-built binaries not installable for [email protected] and [email protected] (node-v115 ABI, unknown) (falling back to source compile with node-gyp)
npm ERR! node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/JCMais/node-libcurl/releases/download/v3.0.0/node_libcurl-v3.0.0-node-v115-win32-x64-unknown.tar.gz
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | win32 | x64
npm ERR! gyp info ok
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | win32 | x64
npm ERR! gyp info find Python using Python version 3.11.7 found at "C:\Python311\python.exe"
npm ERR! gyp info find VS using VS2022 (17.8.34408.163) found at:
npm ERR! gyp info find VS "C:\Program Files\Microsoft Visual Studio\2022\Community"
npm ERR! gyp info find VS run with --verbose for detailed information
npm ERR! gyp info spawn C:\Python311\python.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args 'C:\\Users\\owend\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py',
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'msvs',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'M:\\TDDOWNLOAD\\weibo\\server_js_backup\\node_modules\\node-libcurl\\build\\config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\\Users\\owend\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\\Users\\owend\\AppData\\Local\\node-gyp\\Cache\\20.11.0\\include\\node\\common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=C:\\Users\\owend\\AppData\\Local\\node-gyp\\Cache\\20.11.0',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=C:\\Users\\owend\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=C:\\\\Users\\\\owend\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\20.11.0\\\\<(target_arch)\\\\node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=M:\\TDDOWNLOAD\\weibo\\server_js_backup\\node_modules\\node-libcurl',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args 'M:\\TDDOWNLOAD\\weibo\\server_js_backup\\node_modules\\node-libcurl\\build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! Error: Command failed: cd curl-for-windows && git submodule update --init && python configure.py
npm ERR! Submodule 'curl' (https://github.com/curl/curl.git) registered for path 'curl'
npm ERR! Submodule 'libssh2' (https://github.com/libssh2/libssh2.git) registered for path 'libssh2'
npm ERR! Submodule 'zlib' (https://github.com/madler/zlib.git) registered for path 'zlib'
npm ERR! Cloning into 'M:/TDDOWNLOAD/weibo/server_js_backup/node_modules/node-libcurl/curl-for-windows/curl'...
npm ERR! Cloning into 'M:/TDDOWNLOAD/weibo/server_js_backup/node_modules/node-libcurl/curl-for-windows/libssh2'...
npm ERR! Cloning into 'M:/TDDOWNLOAD/weibo/server_js_backup/node_modules/node-libcurl/curl-for-windows/zlib'...
npm ERR! Traceback (most recent call last):
npm ERR!   File "M:\TDDOWNLOAD\weibo\server_js_backup\node_modules\node-libcurl\curl-for-windows\configure.py", line 151, in <module>
npm ERR!     configure_defines( args )
npm ERR!   File "M:\TDDOWNLOAD\weibo\server_js_backup\node_modules\node-libcurl\curl-for-windows\configure.py", line 91, in configure_defines
npm ERR!     raise Exception('nasm not found.')
npm ERR! Exception: nasm not found.
npm ERR!
npm ERR! gyp: Call to 'node "M:\TDDOWNLOAD\weibo\server_js_backup\node_modules\node-libcurl/scripts/retrieve-win-deps.js"' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack at ChildProcess.<anonymous> (C:\Users\owend\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:271:18)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:518:28)
npm ERR! gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:294:12)
npm ERR! gyp ERR! System Windows_NT 10.0.22621
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\owend\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--module=M:\\TDDOWNLOAD\\weibo\\server_js_backup\\node_modules\\node-libcurl\\lib\\binding\\node_libcurl.node" "--module_name=node_libcurl" "--module_path=M:\\TDDOWNLOAD\\weibo\\server_js_backup\\node_modules\\node-libcurl\\lib\\binding" "--napi_version=9" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v115"
npm ERR! gyp ERR! cwd M:\TDDOWNLOAD\weibo\server_js_backup\node_modules\node-libcurl
npm ERR! gyp ERR! node -v v20.11.0
npm ERR! gyp ERR! node-gyp -v v10.0.1
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\owend\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=M:\TDDOWNLOAD\weibo\server_js_backup\node_modules\node-libcurl\lib\binding\node_libcurl.node --module_name=node_libcurl --module_path=M:\TDDOWNLOAD\weibo\server_js_backup\node_modules\node-libcurl\lib\binding --napi_version=9 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v115' (1)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (M:\TDDOWNLOAD\weibo\server_js_backup\node_modules\@mapbox\node-pre-gyp\lib\util\compile.js:89:23)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:518:28)
npm ERR! node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1105:16)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:305:5)
npm ERR! node-pre-gyp ERR! System Windows_NT 10.0.22621
npm ERR! node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "M:\\TDDOWNLOAD\\weibo\\server_js_backup\\node_modules\\@mapbox\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
npm ERR! node-pre-gyp ERR! cwd M:\TDDOWNLOAD\weibo\server_js_backup\node_modules\node-libcurl
npm ERR! node-pre-gyp ERR! node -v v20.11.0
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v1.0.10
npm ERR! node-pre-gyp ERR! not ok

owendswang avatar Jan 13 '24 14:01 owendswang

well... succeeded when I switched back to node v18.

owendswang avatar Jan 15 '24 04:01 owendswang

I am also stuck in installing on windows with node v20. I also tried with next branch, but no luck.

adarshmadrecha avatar Jan 21 '24 14:01 adarshmadrecha

Node.js v20 did not have prebuilt binaries when you tried to install, thus causing it to try to compile it locally, but in your case, it failed because you are missing nasm:

Exception: nasm not found.

The fix at the time was to install it (instructions are in the README).

However, v4 has been released with prebuitl binaries for v20.

JCMais avatar Feb 13 '24 13:02 JCMais