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

Cannot build on Windows 11 #68

Closed
itsyourap opened this issue Mar 4, 2023 · 4 comments
Closed

Cannot build on Windows 11 #68

itsyourap opened this issue Mar 4, 2023 · 4 comments

Comments

@itsyourap
Copy link

itsyourap commented Mar 4, 2023

I was trying to compile and run httptoolkit-ui following the instructions in the README, but npm install gives me build errors. I tried to investigate the issue and found that it is due to a dependency win-version-info which uses deprecated C++ features according to this.

Here is the terminal output:-

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 @hapi/pinpoint@1.0.2: Moved to 'npm install @sideway/pinpoint'
npm WARN deprecated @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated gulp-header@1.8.12: Removed event-stream from gulp-header
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated har-validator@5.1.3: this library is no longer supported
npm WARN deprecated @hapi/formula@1.2.0: Moved to 'npm install @sideway/formula'
npm WARN deprecated circular-json@0.5.9: CircularJSON is in maintenance only, flatted is its successor.
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 resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated formidable@1.2.6: Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau
npm WARN deprecated html-webpack-plugin@3.2.0: 3.x is no longer supported
npm WARN deprecated @hapi/address@2.1.4: Moved to 'npm install @sideway/address'
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
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 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 @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
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 deprecated @hapi/joi@16.1.8: Switch to 'npm install joi'
npm WARN deprecated axios@0.19.2: Critical security vulnerability fixed in v0.21.1. For more information, see https://github.com/axios/axios/pull/3410
npm WARN deprecated superagent@5.3.1: Please upgrade to v7.0.2+ of superagent.  We have fixed numerous issues with streams, form-data, attach(), filesystem errors not bubbling up (ENOENT on attach()), and all tests are now passing.  See the releases tab for more information at <https://github.com/visionmedia/superagent/releases>. Thanks to @shadowgate15, @spence-s, and @niftylettuce. Superagent is sponsored by Forward Email at <https://forwardemail.net>.
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 WARN cleanup Failed to remove some directories [
npm WARN cleanup   [
npm WARN cleanup     'D:\\httptoolkit-ui\\node_modules\\node-datachannel',
npm WARN cleanup     [Error: EBUSY: resource busy or locked, rmdir 'D:\httptoolkit-ui\node_modules\node-datachannel'] {
npm WARN cleanup       errno: -4082,
npm WARN cleanup       code: 'EBUSY',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'D:\\httptoolkit-ui\\node_modules\\node-datachannel'
npm WARN cleanup     }
npm WARN cleanup   ],
npm WARN cleanup   [
npm WARN cleanup     'D:\\httptoolkit-ui\\node_modules\\registry-js',
npm WARN cleanup     [Error: EBUSY: resource busy or locked, rmdir 'D:\httptoolkit-ui\node_modules\registry-js'] {
npm WARN cleanup       errno: -4082,
npm WARN cleanup       code: 'EBUSY',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'D:\\httptoolkit-ui\\node_modules\\registry-js'
npm WARN cleanup     }
npm WARN cleanup   ],
npm WARN cleanup   [
npm WARN cleanup     'D:\\httptoolkit-ui\\node_modules\\puppeteer',
npm WARN cleanup     [Error: EBUSY: resource busy or locked, rmdir 'D:\httptoolkit-ui\node_modules\puppeteer'] {
npm WARN cleanup       errno: -4082,
npm WARN cleanup       code: 'EBUSY',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'D:\\httptoolkit-ui\\node_modules\\puppeteer'
npm WARN cleanup     }
npm WARN cleanup   ],
npm WARN cleanup   [
npm WARN cleanup     'D:\\httptoolkit-ui\\node_modules\\ssh2',
npm WARN cleanup     [Error: EPERM: operation not permitted, rmdir 'D:\httptoolkit-ui\node_modules\ssh2\lib\protocol\crypto\build\Release\obj'] {
npm WARN cleanup       errno: -4048,
npm WARN cleanup       code: 'EPERM',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'D:\\httptoolkit-ui\\node_modules\\ssh2\\lib\\protocol\\crypto\\build\\Release\\obj'
npm WARN cleanup     }
npm WARN cleanup   ]
npm WARN cleanup ]
npm ERR! code 1
npm ERR! path D:\httptoolkit-ui\node_modules\win-version-info
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node skip.js || prebuild-install || node-gyp rebuild
npm ERR! Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch.
npm ERR!   VersionInfo.cc
npm ERR! D:\httptoolkit-ui\node_modules\nan\nan.h(2544,6): warning C4996: 'v8::ObjectTemplate::SetAccessor': Do signature check in accessor [D:\httptoolkit-ui\node_modules\win-version-info\build\VersionInfo.vcxproj]
npm ERR!   showver.cc
npm ERR! D:\httptoolkit-ui\node_modules\nan\nan.h(2544,6): warning C4996: 'v8::ObjectTemplate::SetAccessor': Do signature check in accessor [D:\httptoolkit-ui\node_modules\win-version-info\build\VersionInfo.vcxproj]
npm ERR! D:\httptoolkit-ui\node_modules\win-version-info\src\showver.cc(111,70): error C2039: 'ptr_fun': is not a member of 'std' [D:\httptoolkit-ui\node_modules\win-version-info\build\VersionInfo.vcxproj]
npm ERR! C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include\locale(25): message : see declaration of 'std' [D:\httptoolkit-ui\node_modules\win-version-info\build\VersionInfo.vcxproj]
npm ERR! D:\httptoolkit-ui\node_modules\win-version-info\src\showver.cc(111,77): error C2065: 'ptr_fun': undeclared identifier [D:\httptoolkit-ui\node_modules\win-version-info\build\VersionInfo.vcxproj]
npm ERR! D:\httptoolkit-ui\node_modules\win-version-info\src\showver.cc(111,78): error C2062: type 'int' unexpected [D:\httptoolkit-ui\node_modules\win-version-info\build\VersionInfo.vcxproj]
npm ERR! D:\httptoolkit-ui\node_modules\win-version-info\src\showver.cc(115,61): error C2039: 'ptr_fun': is not a member of 'std' [D:\httptoolkit-ui\node_modules\win-version-info\build\VersionInfo.vcxproj]
npm ERR! C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include\locale(25): message : see declaration of 'std' [D:\httptoolkit-ui\node_modules\win-version-info\build\VersionInfo.vcxproj]
npm ERR! D:\httptoolkit-ui\node_modules\win-version-info\src\showver.cc(115,68): error C2065: 'ptr_fun': undeclared identifier [D:\httptoolkit-ui\node_modules\win-version-info\build\VersionInfo.vcxproj]
npm ERR! D:\httptoolkit-ui\node_modules\win-version-info\src\showver.cc(115,69): error C2062: type 'int' unexpected [D:\httptoolkit-ui\node_modules\win-version-info\build\VersionInfo.vcxproj]
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.3.1
npm ERR! gyp info using node@18.14.2 | win32 | x64
npm ERR! gyp info find Python using Python version 3.11.2 found at "C:\Users\itsyourap\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\python.exe"
npm ERR! gyp info find VS using VS2019 (16.11.33328.57) found at:
npm ERR! gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools"
npm ERR! gyp info find VS run with --verbose for detailed information
npm ERR! gyp info spawn C:\Users\itsyourap\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\python.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   'C:\\Users\\itsyourap\\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   'D:\\httptoolkit-ui\\node_modules\\win-version-info\\build\\config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'C:\\Users\\itsyourap\\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\\itsyourap\\AppData\\Local\\node-gyp\\Cache\\18.14.2\\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\\itsyourap\\AppData\\Local\\node-gyp\\Cache\\18.14.2',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=C:\\Users\\itsyourap\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\itsyourap\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\18.14.2\\\\<(target_arch)\\\\node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=D:\\httptoolkit-ui\\node_modules\\win-version-info',
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   'D:\\httptoolkit-ui\\node_modules\\win-version-info\\build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   'build/binding.sln',
npm ERR! gyp info spawn args   '/clp:Verbosity=minimal',
npm ERR! gyp info spawn args   '/nologo',
npm ERR! gyp info spawn args   '/p:Configuration=Release;Platform=x64'
npm ERR! gyp info spawn args ]
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
npm ERR! gyp ERR! stack     at ChildProcess.onExit (C:\Users\itsyourap\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:203:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Windows_NT 10.0.22621
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\itsyourap\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd D:\httptoolkit-ui\node_modules\win-version-info
npm ERR! gyp ERR! node -v v18.14.2
npm ERR! gyp ERR! node-gyp -v v9.3.1
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\itsyourap\AppData\Local\npm-cache\_logs\2023-03-04T09_12_17_474Z-debug-0.log

2023-03-04T09_12_17_474Z-debug-0.log

> npm --version
9.5.1
> node --version
v18.14.2

How do I fix these errors and compile this?
Thanks in advance

@itsyourap itsyourap changed the title Cannot build on Windows Cannot build on Windows 11 Mar 5, 2023
@pimterry
Copy link
Member

pimterry commented Mar 6, 2023

I'm not sure why win-version-info won't build on your machine, but it shouldn't be necessary anyway, since they publish prebuilds... Ah, unfortunately, it looks like the version here only includes prebuilds up to Node v14, so yes for Node 18 and other recent versions you'll need an environment that can build this.

This is actually only installed & used via the HTTP Toolkit server dependency, which is very outdated because it's only actually really used for smoke testing here (and the server no longer gets deployed to npm, since that never made much sense, so it's tricky to up date).

I'm going to remove the npm dependency on the server entirely to sort that out, probably some time later this week, and then you won't need dependency at all. In the meantime, if you need this working sooner, you can either:

  • Locally remove the httptoolkit-server dependency and run the server independently yourself (see https://github.com/httptoolkit/httptoolkit-server/)
  • Use Node v14, which should work correctly using prebuilds
  • Work out what's up with the build issue here on your system (that dependency definitely did build in many environments when it was published, so this must be possible)
  • Or just wait until I remove the HTTP Toolkit server dependency and then everything should work automatically

@itsyourap
Copy link
Author

Perfect! I just used Node v14 and built it perfectly.
Thanks a lot ✨

@pimterry
Copy link
Member

pimterry commented Mar 6, 2023

Ok, perfect. I'm going to reopen this for now, just until it's fixed 'properly', but great to hear that that workaround has got you sorted in the meantime.

@pimterry pimterry reopened this Mar 6, 2023
@pimterry
Copy link
Member

pimterry commented Mar 9, 2023

The server dependency is now removed! That should fix this issue completely.

If you run npm start it'll now download the latest official server release for your platform (all bundled together, with its own isolated node etc) and launch it for you. You can also launch the server separately elsewhere, any way you like, and then just use npm run start:web here to start only the UI by itself if you'd prefer.

@pimterry pimterry closed this as completed Mar 9, 2023
guyyaffear pushed a commit to Colman-Cyber-Internship/pipe-ui that referenced this issue Jun 4, 2023
…_yarn/json5-1.0.2

Bump json5 from 1.0.1 to 1.0.2
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

2 participants