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

10.0.0-beta.45+ npm install fails with node-gyp v8.1.0 on windows #741

Closed
4 of 5 tasks
schowave opened this issue Sep 16, 2021 · 11 comments
Closed
4 of 5 tasks

10.0.0-beta.45+ npm install fails with node-gyp v8.1.0 on windows #741

schowave opened this issue Sep 16, 2021 · 11 comments
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@schowave
Copy link

schowave commented Sep 16, 2021

Software versions

Please provide at least OS and version of pact-js

  • OS: Windows 10
  • Consumer Pact library: Pact JS v10.0.0-beta.45+
  • Node Version: 14.17.6

Issue Checklist

Please confirm the following:

  • I have upgraded to the latest
  • I have the read the FAQs in the Readme
  • I have triple checked, that there are no unhandled promises in my code and have read the section on intermittent test failures
  • I have set my log level to debug and attached a log file showing the complete request/response cycle
  • For bonus points and virtual high fives, I have created a reproduceable git repository (see below) to illustrate the problem

Expected behaviour

npm install is possible

Actual behaviour

npm install is not possible

Steps to reproduce

How can someone else reproduce this bug?

Use @pact-foundation/pact 10.0.0-beta.45 in your project as devDependency and try to run npm install.

Current workaround for me is to execute npm i -D [email protected] beforehand, and then the npm install works again.
Does this have something to do with nodejs/node-gyp#2399 or nodejs/gyp-next#121 ?

Relevant log files

l-analyse-analysevorgang-frontend\frontend-components
 WARN  @testing-library/[email protected] requires a peer of @testing-library/dom@>=7.21.4 but none was installed.
 WARN  @typescript-eslint/eslint-plugin > @typescript-eslint/experimental-utils: [email protected] requires a peer of eslint@>=5 but none was installed.
 WARN  @typescript-eslint/eslint-plugin: @typescript-eslint/[email protected] requires a peer of eslint@* but none was installed.
 WARN  @typescript-eslint/[email protected] requires a peer of eslint@^5.0.0 || ^6.0.0 || ^7.0.0 but none was installed.
 WARN  @typescript-eslint/[email protected] requires a peer of eslint@^5.0.0 || ^6.0.0 || ^7.0.0 but none was installed.
 WARN  3 other warnings
Packages: +1824
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 1804, reused 1802, downloaded 0, added 0, done
node_modules/.pnpm/[email protected]/node_modules/core-js-pure: Running postinstall script, done in 258ms
node_modules/.pnpm/[email protected]/node_modules/core-js: Running postinstall script, done in 260ms
node_modules/.pnpm/[email protected]/node_modules/core-js: Running postinstall script, done in 420ms
node_modules/.pnpm/[email protected]/node_modules/ejs: Running postinstall script, done in 426ms
node_modules/.pnpm/[email protected]/node_modules/ref-napi: Running install script, done in 453ms
node_modules/.pnpm/[email protected]/node_modules/node-sass: Running install script, done in 812ms
node_modules/.pnpm/[email protected]/node_modules/node-sass: Running postinstall script, done in 385ms
node_modules/.pnpm/[email protected]/node_modules/ffi-napi: Running install script, failed in 5.5s
.../[email protected]/node_modules/ffi-napi install$ node-gyp-build
│ C:\repos\XXX\frontend\node_modules\.pnpm\[email protected]\node_modules\ffi-napi>if not defined npm_config_nod
│ gyp info it worked if it ends with ok
│ gyp info using [email protected]
│ gyp info using [email protected] | win32 | x64
│ gyp info find Python using Python version 3.9.5 found at "C:\Python39\python.exe"
│ gyp info find VS using VS2019 (16.11.31702.278) found at:
│ gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools"
│ gyp info find VS run with --verbose for detailed information
│ gyp info spawn C:\Python39\python.exe
│ gyp info spawn args [
│ gyp info spawn args   'C:\\Users\\00169562\\AppData\\Roaming\\npm\\node_modules\\pnpm\\dist\\node_modules\\node-gyp\\gyp\\gyp_main.py',
│ gyp info spawn args   'binding.gyp',
│ gyp info spawn args   '-f',
│ gyp info spawn args   'msvs',
│ gyp info spawn args   '-I',
│ gyp info spawn args   'C:\\repos\\XXX\frontend\\node_modules\\.pnpm\\[email protected]\\node_modules\\ffi-na
│ gyp info spawn args   '-I',
│ gyp info spawn args   'C:\\Users\\00169562\\AppData\\Roaming\\npm\\node_modules\\pnpm\\dist\\node_modules\\node-gyp\\addon.gypi',
│ gyp info spawn args   '-I',
│ gyp info spawn args   'C:\\Users\\00169562\\AppData\\Local\\node-gyp\\Cache\\14.17.6\\include\\node\\common.gypi',
│ gyp info spawn args   '-Dlibrary=shared_library',
│ gyp info spawn args   '-Dvisibility=default',
│ gyp info spawn args   '-Dnode_root_dir=C:\\Users\\00169562\\AppData\\Local\\node-gyp\\Cache\\14.17.6',
│ gyp info spawn args   '-Dnode_gyp_dir=C:\\Users\\00169562\\AppData\\Roaming\\npm\\node_modules\\pnpm\\dist\\node_modules\\node-gyp',
│ gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\00169562\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\14.17.6\\\\<(target_arch)\\\\node.lib',
│ gyp info spawn args   '-Dmodule_root_dir=C:\\repos\\XXXX\\frontend\\node_modules\\.pnpm\\[email protected]\\no
│ gyp info spawn args   '-Dnode_engine=v8',
│ gyp info spawn args   '--depth=.',
│ gyp info spawn args   '--no-parallel',
│ gyp info spawn args   '--generator-output',
│ gyp info spawn args   'C:\\repos\\XXX\\frontend\\node_modules\\.pnpm\\[email protected]\\node_modules\\ffi-na
│ gyp info spawn args   '-Goutput_dir=.'
│ gyp info spawn args ]
│ gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe
│ gyp info spawn args [
│ gyp info spawn args   'build/binding.sln',
│ gyp info spawn args   '/clp:Verbosity=minimal',
│ gyp info spawn args   '/nologo',
│ gyp info spawn args   '/p:Configuration=Release;Platform=x64'
│ gyp info spawn args ]
│ Die Projekte in dieser Projektmappe werden nacheinander erstellt. Um eine parallele Erstellung zu erm�glichen, m�ssen Sie den Schalter "-m" hinzuf�gen.
│   nothing.vcxproj -> C:\repos\XXX\frontend\node_modules\.pnpm\[email protected]\node_modules\ffi-napi\build\Re
│   Preprocessing assembly file ..\..\..\deps\libffi\src\x86\win64_intel.preasm
│   Der Befehl ""preprocess_asm.cmd"" ist entweder falsch geschrieben oder
│   konnte nicht gefunden werden.
│ C:\repos\XXX\frontend\node_modules\.pnpm\[email protected]\node_modules\ffi-napi\build\deps\libffi\ffi.targets
│ gyp ERR! build error 
│ gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
│ gyp ERR! stack     at ChildProcess.onExit (C:\Users\00169562\AppData\Roaming\npm\node_modules\pnpm\dist\node_modules\node-gyp\lib\build.js:194:23)
│ gyp ERR! stack     at ChildProcess.emit (events.js:400:28)
│ gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
│ gyp ERR! System Windows_NT 10.0.19042
│ gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\00169562\\AppData\\Roaming\\npm\\node_modules\\pnpm\\dist\\node_modules\\node-gyp\\bin
│ gyp ERR! cwd C:\repos\XXX\frontend\node_modules\.pnpm\[email protected]\node_modules\ffi-napi
│ gyp ERR! node -v v14.17.6
│ gyp ERR! node-gyp -v v8.1.0
│ gyp ERR! not ok 
└─ Failed in 5.5s
 ELIFECYCLE  Command failed with exit code 1.
 ERROR  Command failed with exit code 1.
@schowave schowave added the bug Indicates an unexpected problem or unintended behavior label Sep 16, 2021
@mefellows
Copy link
Member

hmm interesting, it could be. Our Windows builds seem to be passing, but 🤷 .

By any chance, do any of the latter versions work (e.g. beta.49?)

@schowave
Copy link
Author

schowave commented Sep 16, 2021

I tried beta.45-49 but none of those seem to work. Only beta.44 works. Maybe this is also a local problem. On our jenkins build machine we had to install gcc-c++ compiler to be able to build it again.

@TimothyJones
Copy link
Contributor

TimothyJones commented Sep 16, 2021

Thanks for the report. It's strange, because we have windows builds running fine in CI.

I think you're right that this is a regression in node-gyp. Since node-gyp is bundled with npm, it's not super clear what we can do to fix it, other than wait for the next version of npm to be released again (I think?).

I'm keen to get to the bottom of why this is happening for you but not in CI - what version of npm are you using? Do you know if you have changed the version of node-gyp from the bundled one?

Our windows builds use npm versions 6.14.12 and 6.14.15 (depending on the node version). For node 14, we use the same version you are using, v14.17.6. Hmm.

@TimothyJones TimothyJones changed the title 10.0.0-beta.45+ no npm install possible under windows 10.0.0-beta.45+ npm install fails with node-gyp v8.1.0 on windows Sep 16, 2021
@schowave
Copy link
Author

schowave commented Sep 17, 2021

We are using the latest version of pnpm and on our CI Server (which is a SUSE Linux Enterprise) we had to install gcc-c++ package for pnpm to be able to build the project with beta.45+

@schowave
Copy link
Author

I finally managed to solve the "problem" by deleting the local pnpm store and build everything from scratch again. This is not a problem of pact-js. Sorry for the circumstances!

@TimothyJones
Copy link
Contributor

Glad it's sorted! Thanks for the update!

@mefellows
Copy link
Member

Thanks @schowave - did you still need to have gcc-c++ for this to work?

@TimothyJones this is a good reminder. Perhaps we should have a "compatibility" table or something with these sorts of things (e.g. yarn2, npm, pnpm)?

@TimothyJones
Copy link
Contributor

That’s a good idea.

This one will go away, I think. It’s a regression in node gyp 8.1.0 which looks like it is fixed in 8.2.0

@TimothyJones
Copy link
Contributor

We should link to the windows instructions for node-gyp, though. Since it won’t work without node-gyp

@schowave
Copy link
Author

schowave commented Oct 26, 2021

We were using an older version of pnpm (6.7.1). With the current version 6.18.0 everything works fine again.

@mefellows
Copy link
Member

Thanks for clarifying.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants