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

node-gyp-build Environmental dependency issues #578

Open
itmanyong opened this issue May 18, 2023 · 3 comments
Open

node-gyp-build Environmental dependency issues #578

itmanyong opened this issue May 18, 2023 · 3 comments

Comments

@itmanyong
Copy link

itmanyong commented May 18, 2023

          @privatenumber Any update on this? Regarding this fixed, please reopen if not.

Originally posted by @tdewolff in #519 (comment)

  • This problem seems to have not been resolved, as follows
PS D:\Users\itmanyong\Desktop\gulp-wx> pnpm add @tdewolff/minify -D
 WARN  deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
 WARN  deprecated read-package-tree@5.3.1: The functionality that this package provided is now in @npmcli/arborist
 WARN  deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
 WARN  deprecated fsevents@1.2.13: The v1 package contains DANGEROUS / INSECURE binaries. Upgrade to safe fsevents v2
 WARN  deprecated readdir-scoped-modules@1.1.0: This functionality has been moved to @npmcli/fs
 WARN  deprecated source-map-resolve@0.6.0: See https://github.com/lydell/source-map-resolve#deprecated
 WARN  deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
 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.
 WARN  deprecated flatten@1.0.3: flatten is deprecated in favor of utility frameworks such as lodash.
 WARN  deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
 WARN  deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
 WARN  deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
 WARN  deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
 WARN  deprecated @npmcli/move-file@2.0.1: This functionality has been moved to @npmcli/fs
Packages: +842
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 847, reused 845, downloaded 0, added 0, done
node_modules/.pnpm/@tdewolff+minify@2.12.5/node_modules/@tdewolff/minify: Running install script, failed in 1.7s
.../node_modules/@tdewolff/minify install$ node-gyp-build
│ gyp info it worked if it ends with ok
│ gyp info using node-gyp@9.3.1
│ gyp info using node@18.12.1 | win32 | x64
│ gyp info find Python using Python version 3.10.8 found at "C:\Users\itmanyong\AppData\Local\Programs\Python\Python310\python.exe"
│ gyp ERR! find VS
│ gyp ERR! find VS msvs_version not set from command line or npm config
│ gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
│ gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer, try re-running with '--loglevel silly' for more details
│ gyp ERR! find VS looking for Visual Studio 2015
│ gyp ERR! find VS - not found
│ gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
│ gyp ERR! find VS
│ gyp ERR! find VS **************************************************************
│ gyp ERR! find VS You need to install the latest version of Visual Studio
│ gyp ERR! find VS including the "Desktop development with C++" workload.
│ gyp ERR! find VS For more information consult the documentation at:
│ gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
│ gyp ERR! find VS **************************************************************
│ gyp ERR! find VS
│ gyp ERR! configure error
│ gyp ERR! stack Error: Could not find any Visual Studio installation to use
│ gyp ERR! stack     at VisualStudioFinder.fail (D:\Users\itmanyong\Desktop\gulp-wx\node_modules\.pnpm\node-gyp@9.3.1\node_modules\node-gyp\lib\find-visualstudi
│ gyp ERR! stack     at D:\Users\itmanyong\Desktop\gulp-wx\node_modules\.pnpm\node-gyp@9.3.1\node_modules\node-gyp\lib\find-visualstudio.js:75:16
│ gyp ERR! stack     at VisualStudioFinder.findVisualStudio2013 (D:\Users\itmanyong\Desktop\gulp-wx\node_modules\.pnpm\node-gyp@9.3.1\node_modules\node-gyp\lib\
│ gyp ERR! stack     at D:\Users\itmanyong\Desktop\gulp-wx\node_modules\.pnpm\node-gyp@9.3.1\node_modules\node-gyp\lib\find-visualstudio.js:71:14
│ gyp ERR! stack     at D:\Users\itmanyong\Desktop\gulp-wx\node_modules\.pnpm\node-gyp@9.3.1\node_modules\node-gyp\lib\find-visualstudio.js:390:16
│ gyp ERR! stack     at D:\Users\itmanyong\Desktop\gulp-wx\node_modules\.pnpm\node-gyp@9.3.1\node_modules\node-gyp\lib\util.js:54:7
│ gyp ERR! stack     at D:\Users\itmanyong\Desktop\gulp-wx\node_modules\.pnpm\node-gyp@9.3.1\node_modules\node-gyp\lib\util.js:33:16
│ gyp ERR! stack     at ChildProcess.exithandler (node:child_process:420:5)
│ gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
│ gyp ERR! stack     at maybeClose (node:internal/child_process:1091:16)
│ gyp ERR! System Windows_NT 10.0.18363
│ gyp ERR! command "D:\\nodejs\\node.exe" "D:\\Users\\itmanyong\\Desktop\\gulp-wx\\node_modules\\.pnpm\\node-gyp@9.3.1\\node_modules\\node-gyp\\bin\\node-gyp.js
│ gyp ERR! cwd D:\Users\itmanyong\Desktop\gulp-wx\node_modules\.pnpm\@tdewolff+minify@2.12.5\node_modules\@tdewolff\minify
│ gyp ERR! node -v v18.12.1
│ gyp ERR! node-gyp -v v9.3.1
│ gyp ERR! not ok
└─ Failed in 1.7s at D:\Users\itmanyong\Desktop\gulp-wx\node_modules\.pnpm\@tdewolff+minify@2.12.5\node_modules\@tdewolff\minify
 ELIFECYCLE  Command failed with exit code 1.
PS D:\Users\itmanyong\Desktop\gulp-wx>
  • My system information
PS D:\Users\itmanyong\Desktop\gulp-wx> npx envinfo --system --binaries

  System:
    OS: Windows 10 10.0.18363
    CPU: (8) x64 Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz
    Memory: 5.83 GB / 15.95 GB
  Binaries:
    Node: 18.12.1 - D:\nodejs\node.EXE
    Yarn: 1.22.18 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 8.9.0 - D:\nodejs\npm.CMD

PS D:\Users\itmanyong\Desktop\gulp-wx>
  • Attempted to clean local cache and install separately npm install node-gyp-build@latest -g,Still not working
@itmanyong itmanyong changed the title @privatenumber Any update on this? Regarding this fixed, please reopen if not. node-gyp-build 环境依赖问题 May 18, 2023
@itmanyong itmanyong changed the title node-gyp-build 环境依赖问题 node-gyp-build Environmental dependency issues May 18, 2023
@tdewolff
Copy link
Owner

When I wrote the script, it was near impossible to make it work on Windows. It works on MacOS and Linux however. I will see if this has changed, but unfortunately I have no Windows available to test.

@itmanyong
Copy link
Author

When I wrote the script, it was near impossible to make it work on Windows. It works on MacOS and Linux however. I will see if this has changed, but unfortunately I have no Windows available to test.

This is very uncomfortable. Windows environments can be built using virtual machines, but I don't know if such a virtual environment meets the requirements. This library is great! I hope to consider compatibility with Windows in my spare time. This will add a lot of points. Thank you for creating it

@tdewolff
Copy link
Owner

The problem is much worse. After working on this for two days, it seems that Go/CGO only compiles with GCC, and node-gyp only compiles with MSVC, and the resulting node library is not working. The problem that occurs is: "Error: Module did not self-register". In your specific case though, you didn't install VS, see https://github.com/tdewolff/minify/tree/master/bindings/js#installation-on-windows

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