Closed wj45911 closed 4 months ago
This happens because there's a native Node module used as a dependency within some projects here called node-datachannel
. This module requires native compilation.
Because this can be tricky for some users, as a solution that module publishes prebuilt binaries for various recognized environments, including Linux + Node v20 + x64 (your environment). What should happen is that the install process checks your environment, and just downloads the matching precompiled version of the dependency and uses that.
npm ERR! prebuild-install WARN install Request timed out
Unfortunately that download fails here. For some reason the connection (to github.com) times out and it can't download the prebuilt binary.
npm ERR! ERR! OMG CMake executable is not found. Please use your system's package manager to install it, or you can get installers from there: http://cmake.org/.
Since it can't download the prebuilt version, the install tries to compile it from scratch, but your system doesn't have a working C build environment, so that fails.
This isn't really related to HTTP Toolkit - this is a general problem with native module compilation. There's two ways to fix this:
build-essential
. I'm not sure if there's a CentOS equivalent but I'd suggest installing the requirements from the node-gyp docs, re-running this command, and thenm installing anything else the errors say is missing until it works.
centos7 My nodejs version is 20.11.1 npm config set registry https://registry.npmmirror.com/ Then there was an error in npm install [root@ecs-92a4 httptoolkit-ui-main]# npm install npm WARN deprecated @types/classnames@2.3.1: This is a stub types definition. classnames provides its own type definitions, so you do not need this installed. npm WARN deprecated mkdirp-promise@1.1.0: This package is broken and no longer maintained. 'mkdirp' itself supports promises now, please switch to that. npm WARN deprecated gulp-header@1.8.12: Removed event-stream from gulp-header npm WARN deprecated trim@1.0.1: Use String.prototype.trim() instead npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated npm WARN deprecated rollup-plugin-terser@7.0.2: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser npm WARN deprecated har-validator@5.1.3: this library is no longer supported npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated npm WARN deprecated circular-json@0.5.9: CircularJSON is in maintenance only, flatted is its successor. npm WARN deprecated sourcemap-codec@1.4.8: Please use @jridgewell/sourcemap-codec instead npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies npm WARN deprecated uuid@3.3.2: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. npm WARN deprecated vscode-emmet-helper@1.2.11: This package has been renamed to @vscode/emmet-helper, please update to the new name npm WARN deprecated puppeteer@5.4.0: < 21.5.0 is no longer supported npm WARN deprecated core-js@1.2.7: core-js@<3.4 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js. npm WARN deprecated core-js@2.6.12: core-js@<3.4 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js. npm ERR! code 2 npm ERR! path /app/red-booklet/httptoolkit/httptoolkit-ui-main/node_modules/node-datachannel npm ERR! command failed npm ERR! command sh -c prebuild-install || (npm install --ignore-scripts --production=false && npm run _prebuild) npm ERR! added 598 packages, and removed 1 package in 9s npm ERR! npm ERR! 7 packages are looking for funding npm ERR! run (/app/red-booklet/httptoolkit/httptoolkit-ui-main/node_modules/node-datachannel/node_modules/prebuild/cmakebuild.js:32:19)
npm ERR! prebuild ERR! build at ChildProcess.emit (node:events:518:28)
npm ERR! prebuild ERR! build at ChildProcess._handle.onexit (node:internal/child_process:294:12)
npm fund
for details npm ERR! npm ERR! > node-datachannel@0.4.3 _prebuild npm ERR! > prebuild --backend cmake-js npm ERR! npm ERR! [ npm ERR! '/root/.nvm/versions/node/v20.11.1/bin/node', npm ERR! '/app/red-booklet/httptoolkit/httptoolkit-ui-main/node_modules/node-datachannel/node_modules/.bin/cmake-js', npm ERR! 'rebuild', npm ERR! '--runtime-version=20.11.1', npm ERR! '--arch=x64', npm ERR! '--runtime=node' npm ERR! ] npm ERR! prebuild-install WARN install Request timed out npm ERR! npm WARN config production Use--omit=dev
instead. npm ERR! npm WARN deprecated har-validator@5.1.5: this library is no longer supported npm ERR! npm WARN deprecated abab@2.0.6: Use your platform's native atob() and btoa() methods instead npm ERR! npm WARN deprecated domexception@2.0.1: Use your platform's native DOMException instead npm ERR! npm WARN deprecated w3c-hr-time@1.0.2: Use your platform's native performance.now() and performance.timeOrigin. npm ERR! npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. npm ERR! npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 npm ERR! npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap. npm ERR! npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap. npm ERR! prebuild info begin Prebuild version 11.0.4 npm ERR! prebuild info build Preparing to prebuild node-datachannel@0.4.3 for node 20.11.1 on linux-x64 using cmake-js npm ERR! info TOOL Using Unix Makefiles generator. npm ERR! ERR! OMG CMake executable is not found. Please use your system's package manager to install it, or you can get installers from there: http://cmake.org. npm ERR! prebuild ERR! build Error: Failed to build cmake with exit code 1 npm ERR! prebuild ERR! build at ChildProcess.