Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't install the module using node:21 #108

Open
pimterry opened this issue Feb 19, 2024 · 1 comment
Open

Can't install the module using node:21 #108

pimterry opened this issue Feb 19, 2024 · 1 comment

Comments

@pimterry
Copy link
Member

          i can't install the module using node:21
C:\Users\Administrator\Documents\Project\httptoolkit-server>npm install
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'httptoolkit-server@1.14.9',
npm WARN EBADENGINE   required: { node: '20.11.1' },
npm WARN EBADENGINE   current: { node: 'v21.4.0', npm: '10.2.5' }
npm WARN EBADENGINE }
npm WARN deprecated request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
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 WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.3: this library is no longer supported
npm WARN deprecated cli-ux@5.6.7: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm WARN cleanup Failed to remove some directories [
npm WARN cleanup   [
npm WARN cleanup     'C:\\Users\\Administrator\\Documents\\Project\\httptoolkit-server\\node_modules\\ssh2',
npm WARN cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\Users\Administrator\Documents\Project\httptoolkit-server\node_modules\ssh2\lib\protocol'] {
npm WARN cleanup       errno: -4048,
npm WARN cleanup       code: 'EPERM',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'C:\\Users\\Administrator\\Documents\\Project\\httptoolkit-server\\node_modules\\ssh2\\lib\\protocol'
npm WARN cleanup     }
npm WARN cleanup   ],
npm WARN cleanup   [
npm WARN cleanup     'C:\\Users\\Administrator\\Documents\\Project\\httptoolkit-server\\node_modules\\node-datachannel',
npm WARN cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\Users\Administrator\Documents\Project\httptoolkit-server\node_modules\node-datachannel\node_modules\@istanbuljs\load-nyc-config'] {
npm WARN cleanup       errno: -4048,
npm WARN cleanup       code: 'EPERM',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'C:\\Users\\Administrator\\Documents\\Project\\httptoolkit-server\\node_modules\\node-datachannel\\node_modules\\@istanbuljs\\load-nyc-config'
npm WARN cleanup     }
npm WARN cleanup   ]
npm WARN cleanup ]
npm ERR! code 2
npm ERR! path C:\Users\Administrator\Documents\Project\httptoolkit-server\node_modules\node-datachannel
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c prebuild-install || (npm install --ignore-scripts --production=false && npm run _prebuild)
npm ERR! added 604 packages, removed 1 package, and audited 662 packages in 1m
npm ERR!
npm ERR! 69 packages are looking for funding
npm ERR!   run `npm fund` for details
npm ERR!
npm ERR! 11 vulnerabilities (7 moderate, 4 high)
npm ERR!
npm ERR! To address issues that do not require attention, run:
npm ERR!   npm audit fix
npm ERR!
npm ERR! To address all issues (including breaking changes), run:
npm ERR!   npm audit fix --force
npm ERR!
npm ERR! Run `npm audit` for details.
npm ERR!
npm ERR! > node-datachannel@0.4.3 _prebuild
npm ERR! > prebuild --backend cmake-js
npm ERR!
npm ERR! [
npm ERR!   'C:\\Program Files\\nodejs\\node.exe',
npm ERR!   'C:\\Users\\Administrator\\Documents\\Project\\httptoolkit-server\\node_modules\\node-datachannel\\node_modules\\cmake-js\\bin\\cmake-js',
npm ERR!   'rebuild',
npm ERR!   '--runtime-version=21.4.0',
npm ERR!   '--arch=x64',
npm ERR!   '--runtime=node'
npm ERR! ]
npm ERR! prebuild-install WARN install No prebuilt binaries found (target=21.4.0 runtime=node arch=x64 libc= platform=win32)
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 21.4.0 on win32-x64 using cmake-js
npm ERR! ERR! OMG CMake is not installed. Install CMake.
npm ERR! ERR! OMG CMake is not installed. Install CMake.
npm ERR! prebuild ERR! build Error: Failed to build cmake with exit code 1
npm ERR! prebuild ERR! build     at ChildProcess.<anonymous> (C:\Users\Administrator\Documents\Project\httptoolkit-server\node_modules\node-datachannel\node_modules\prebuild\cmakebuild.js:32:19)
npm ERR! prebuild ERR! build     at ChildProcess.emit (node:events:519:28)
npm ERR! prebuild ERR! build     at ChildProcess._handle.onexit (node:internal/child_process:294:12)

npm ERR! A complete log of this run can be found in: C:\Users\Administrator\AppData\Local\npm-cache\_logs\2024-02-18T19_33_36_865Z-debug-0.log

C:\Users\Administrator\Documents\Project\httptoolkit-server>npm run dev
npm ERR! Missing script: "dev"
npm ERR!
npm ERR! To see a list of scripts, run:
npm ERR!   npm run

npm ERR! A complete log of this run can be found in: C:\Users\Administrator\AppData\Local\npm-cache\_logs\2024-02-18T19_39_39_425Z-debug-0.log

Originally posted by @fdciabdul in #105 (comment)

@pimterry
Copy link
Member Author

Hi @fdciabdul.

It looks like this there's a few things going on here:

  • You're using Node 21. This is a non-LTS Node version (like all odd-numbered Node versions) and HTTP Toolkit server doesn't actively test against or support it. It'll probably work, but if you want to be sure it's best to use the latest LTS version (v20.11.1).
  • For some reason, your permissions are blocking some install scripts from dependencies from managing their own files. I'm not sure what would cause that but that sounds like either a permissions or npm configuration issue that you'll need to investigate. It looks like this might just be a warning though rather than an error, so maybe you can ignore that.
  • A native build is failing, because you don't have a working native build environment on your machine (CMake at least, possible other missing system tools). In general it's useful to have this set up so you can use native modules in Node.js, but alternatively the native build here is actually only running because a subdependency uses native code but only provides prebuilt binaries for Node v20. If you switch to Node v20 the prebuilt version should be used, which will skip this completely.
  • You're running npm run dev but that script doesn't exist, and has never existed. I'm not sure where you've got that from. You can see the scripts available in package.json. There's a guide for local dev in the README here, in general you want to use npm start to run the server locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant