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.

CI (Windows): got unexpected output when executing "npm run build-setup-python"

See original GitHub issue

What happened

On the Windows runner, we got two errors (TS7016 and TS2322) during the execution of the “npm run build” step. We can view the logs in test (windows-2019, 5.9.0) or test (windows-2019, 5.15.1):

> install-qt-action@0.0.0 build-setup-python D:\a\install-qt-action\install-qt-action
> npm install --prefix node_modules/setup-python && npm run build --prefix node_modules/setup-python

+ install-qt-action@0.0.0
added 1 package from 1 contributor in 0.14s

> setup-python@2.0.1 build D:\a\install-qt-action\install-qt-action\node_modules\setup-python
> tsc

Error: src/find-python.ts(4,25): error TS7016: Could not find a declaration file for module 'semver'. 'D:/a/install-qt-action/install-qt-action/node_modules/semver/index.js' implicitly has an 'any' type.
  Try `npm install @types/semver` if it exists or add a new declaration (.d.ts) file containing `declare module 'semver';`
Error: src/install-python.ts(39,5): error TS2322: Type '{ [key: string]: string | undefined; } | { LD_LIBRARY_PATH: string; }' is not assignable to type '{ [key: string]: string; } | undefined'.
  Type '{ [key: string]: string | undefined; }' is not assignable to type '{ [key: string]: string; }'.
    Index signatures are incompatible.
      Type 'string | undefined' is not assignable to type 'string'.
        Type 'undefined' is not assignable to type 'string'.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! setup-python@2.0.1 build: `tsc`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the setup-python@2.0.1 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\npm\cache\_logs\...-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! install-qt-action@0.0.0 build-setup-python: `npm install --prefix node_modules/setup-python && npm run build --prefix node_modules/setup-python`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the install-qt-action@0.0.0 build-setup-python script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\npm\cache\_logs\...-debug.log

> install-qt-action@0.0.0 build D:\a\install-qt-action\install-qt-action
> tsc

Essentially, two npm scripts were executed in this step:

Code in the workflow step npm script
npm run build-setup-python npm install --prefix node_modules/setup-python && npm run build --prefix node_modules/setup-python
npm run build tsc

According to the output, we know that the errors occurred when executing npm run build --prefix node_modules/setup-python . However, the workflow was not interrupted at all, and the subsequent call to tsc was successful. In other words, the imported library “node_modules/setup-python/lib/find-python.js” was built successfully.

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
pzhlkj6612commented, Jan 21, 2022

For early adopters of PowerShell (pwsh):

In PowerShell 7.3.0-preview.1, set $PSNativeCommandUseErrorActionPreference to $true and $ErrorActionPreference to 'Stop' can stop script execution when native command error occurs (behaves like set -e in Bash shell).

Test code:

& {
    $PSNativeCommandUseErrorActionPreference = $true;
    $ErrorActionPreference = 'Stop';
    ping.exe bbb;
    ping.exe aaa;
}

Please see PowerShell/PowerShell#3415 for details.

0reactions
ddalcinocommented, Nov 24, 2021

Is there any movement on this issue? I opened #123 more than a month ago, and it fixes the root cause of this issue. I also opened #122, which will fix the error on Windows builds that occurs when running dir on this line: https://github.com/jurplel/install-qt-action/blob/10cbdcd020ebd47297c2c40d37d610fed13f7d93/.github/workflows/test.yml#L39

@jurplel, please note that if you run the workflow for either #122 or #123 right now, they will fail because the test.yml workflow specifies a version of QtIFW which is no longer available. You could fix that the same way #118 did, if you’re not ready to use #119 yet.

Read more comments on GitHub >

github_iconTop Results From Across the Web

error: This is probably not a problem with npm. There is likely ...
we were using "npm run build -- --configuration=prod --base-href=/path/". It worked for all other config params except this prod. So i ended up ......
Read more >
Common errors | npm Docs
You are trying to install on a drive that either has no space, or has no permission to write. Free some disk space...
Read more >
Npm install command failing with message "could not find ...
When I run the npm install command, npm starts downloading the dependencies. But then, suddenly, it stops with the error:
Read more >
Three Things You Didn't Know You Could Do with npm Scripts
Before we get started, make sure you have the latest version of npm installed. ... These can then be executed using npm run...
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