question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

@bugsnag/electron 7.14.0 fails to compile on Azure pipelines Windows 10

See original GitHub issue

Describe the bug

@bugsnag/electron fails to compile on Azure pipelines Windows 10 during yarn install

Steps to reproduce

  1. Upgraded existing electron project to us @bugsnag/electron 7.14.0
  2. run yarn install
  3. See error

Environment

  • Bugsnag version: 7.14.0
  • Electron 15.3.1
  • Electron-forge 6.0.0-beta.61
  • Node 16.5.0
  • Python 3.8.10, 3.10.0
  • Yarn 1.22.5

Example Azure pipeline error message

Error messages:
[5/5] Building fresh packages...
error D:\a\1\s\node_modules\@bugsnag\plugin-electron-app: Command failed.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Exit code: 1
Command: node-gyp rebuild
Arguments: 
Directory: D:\a\1\s\node_modules\@bugsnag\plugin-electron-app
Output:
D:\a\1\s\node_modules\@bugsnag\plugin-electron-app>if not defined npm_config_node_gyp (node "C:\hostedtoolcache\windows\node\16.5.0\x64\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild ) 
gyp info it worked if it ends with ok
gyp info using node-gyp@7.1.2
gyp info using node@16.5.0 | win32 | x64
gyp info find Python using Python version 3.8.10 found at "C:\hostedtoolcache\windows\Python\3.8.10\x64\python3.exe"
gyp http GET https://nodejs.org/download/release/v16.5.0/node-v16.5.0-headers.tar.gz
gyp http 200 https://nodejs.org/download/release/v16.5.0/node-v16.5.0-headers.tar.gz
gyp http GET https://nodejs.org/download/release/v16.5.0/SHASUMS256.txt
gyp http GET https://nodejs.org/download/release/v16.5.0/win-x86/node.lib
gyp http GET https://nodejs.org/download/release/v16.5.0/win-x64/node.lib
gyp http GET https://nodejs.org/download/release/v16.5.0/win-arm64/node.lib
gyp http 404 https://nodejs.org/download/release/v16.5.0/win-arm64/node.lib
gyp http 200 https://nodejs.org/download/release/v16.5.0/win-x64/node.lib
gyp http 200 https://nodejs.org/download/release/v16.5.0/SHASUMS256.txt
gyp http 200 https://nodejs.org/download/release/v16.5.0/win-x86/node.lib
gyp info find VS using VS2019 (16.11.31829.152) found at:
gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise"
gyp info find VS run with --verbose for detailed information
(node:5200) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
(Use `node --trace-deprecation ...` to show where the warning was created)
gyp info spawn C:\hostedtoolcache\windows\Python\3.8.10\x64\python3.exe
gyp info spawn args [
gyp info spawn args   'C:\\hostedtoolcache\\windows\\node\\16.5.0\\x64\\node_modules\\npm\\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   'D:\\a\\1\\s\\node_modules\\@bugsnag\\plugin-electron-app\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\hostedtoolcache\\windows\\node\\16.5.0\\x64\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\VssAdministrator\\AppData\\Local\\node-gyp\\Cache\\16.5.0\\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\\VssAdministrator\\AppData\\Local\\node-gyp\\Cache\\16.5.0',
gyp info spawn args   '-Dnode_gyp_dir=C:\\hostedtoolcache\\windows\\node\\16.5.0\\x64\\node_modules\\npm\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\VssAdministrator\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\16.5.0\\\\<(target_arch)\\\\node.lib',
gyp info spawn args   '-Dmodule_root_dir=D:\\a\\1\\s\\node_modules\\@bugsnag\\plugin-electron-app',
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   'D:\\a\\1\\s\\node_modules\\@bugsnag\\plugin-electron-app\\build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\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 ]
Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch.
  api.c
C:\Users\VssAdministrator\AppData\Local\node-gyp\Cache\16.5.0\include\node\node_api.h(12,10): fatal error C1083: Cannot open include file: 'js_native_api.h': No such file or directory [D:\a\1\s\node_modules\@bugsnag\plugin-electron-app\build\bugsnag_plugin_electron_app_bindings.vcxproj]
gyp ERR! build error 
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\hostedtoolcache\windows\node\16.5.0\x64\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (node:events:394:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
gyp ERR! System Windows_NT 10.0.17763
gyp ERR! command "C:\\hostedtoolcache\\windows\\node\\16.5.0\\x64\\node.exe" "C:\\hostedtoolcache\\windows\\node\\16.5.0\\x64\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\a\1\s\node_modules\@bugsnag\plugin-electron-app
gyp ERR! node -v v16.5.0
gyp ERR! node-gyp -v v7.1.2
gyp ERR! not ok
##[error]Cmd.exe exited with code '1'.
Finishing: Yarn install

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
zac-jacobsoncommented, Nov 24, 2021

Thanks for the suggestions @xander-jones . We do have node-gyp@8.4.1 in the project, but as you point out, it was the global dependancy that needed to be updated.

I can confirm that running this Azure step before yarn install

- script: 'npm --verbose install --global node-gyp@8.4.1'
  displayName: 'Bump system node-gyp'

Allowed the install to complete successfully.

0reactions
zac-jacobsoncommented, Jan 26, 2022

Follow up

Sometime after the above discussion, we started having problems again, and just reverted to v7.13.3

Today, though, we discovered that the real problem appears to be with Azure’s Cache task: it is broken on Windows, and not all modules are reconstituted correctly. To get around this, we added a step after the Cache restoration to delete the directory for this module in particular, and then when yarn install run, it is fetches and builds correctly, so now we can finally update this module.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot pipeline runs - Azure DevOps - Microsoft Learn
Pipeline won't trigger; Pipeline queues but never gets an agent; Pipeline fails to complete; Get logs to diagnose problems; I need more help ......
Read more >
After upgrade for version 4.0.0 of dependencie azure ... - GitHub
Yesterday after the commit for upgrade, it started to not work anymore, right after this e526642 : Error logs Found 0 files /usr/bin/zip...
Read more >
Azure pipeline error with Windows VM - Visual Studio Feedback
I am currently experiencing problems running the following https://dev.azure.com/matteoravasi/PyLops/_build/results?buildId=39&view=logs&j=50448a2f-9550-51a0- ...
Read more >
How to get an Azure pipeline for Go to work - Stack Overflow
microsoft but it fails with the error below. Does someone have a .yaml file that works for a Go pipeline in Azure DevOps?...
Read more >
GitHub integration with Azure Pipelines - Azure DevOps Labs
Microsoft ??? Any response. The build seems to work until we add the testing steps... then the npm install step fails with a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found