Skip to content
This repository has been archived by the owner on Feb 12, 2025. It is now read-only.

Cannot find module '@npmcli/run-script' when using v1.0.33 #111

Closed
pioneer2k opened this issue Jul 12, 2021 · 13 comments · Fixed by #115 or #117
Closed

Cannot find module '@npmcli/run-script' when using v1.0.33 #111

pioneer2k opened this issue Jul 12, 2021 · 13 comments · Fixed by #115 or #117
Labels
bug Something isn't working released

Comments

@pioneer2k
Copy link
Contributor

Describe the bug
When using the asyncapi/[email protected] (maybe 1.0.32 as well) I get the following error in GitHub Actions:

Error: Cannot find module '@npmcli/run-script'
Require stack:

  • /home/runner/work/_actions/asyncapi/github-action-for-generator/v1.0.33/dist/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15)
    at Function.Module._load (internal/modules/cjs/loader.js:690:27)
    at Module.require (internal/modules/cjs/loader.js:852:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.27352 (/home/runner/work/_actions/asyncapi/github-action-for-generator/v1.0.33/webpack:/github-action-for-generator/external "@npmcli/run-script":1:1)
    at nccwpck_require (/home/runner/work/_actions/asyncapi/github-action-for-generator/v1.0.33/webpack:/github-action-for-generator/webpack/bootstrap:21:1)
    at Object.9699 (/home/runner/work/_actions/asyncapi/github-action-for-generator/v1.0.33/webpack:/github-action-for-generator/node_modules/pacote/lib/dir.js:13:1)
    at nccwpck_require (/home/runner/work/_actions/asyncapi/github-action-for-generator/v1.0.33/webpack:/github-action-for-generator/webpack/bootstrap:21:1)
    at Object.97545 (/home/runner/work/_actions/asyncapi/github-action-for-generator/v1.0.33/webpack:/github-action-for-generator/node_modules/pacote/lib/git.js:4:1)
    at nccwpck_require (/home/runner/work/_actions/asyncapi/github-action-for-generator/v1.0.33/webpack:/github-action-for-generator/webpack/bootstrap:21:1)

With v1.0.31 everything is working. But we need the new version for fixing the issue 103.

How to Reproduce
use the github-action with v1.0.33 like this

 - name: Generating HTML from AsyncAPI document
    uses: asyncapi/[email protected]
    with:
      template: '@asyncapi/[email protected]' 
      filepath: src/main/resources/asyncapi.yml
      parameters: baseHref=/customer-context-asyncapi-generated-html/
      output: asyncapi/customer-context-asyncapi-generated-html

Expected behavior
no error

@pioneer2k pioneer2k added the bug Something isn't working label Jul 12, 2021
@derberg
Copy link
Member

derberg commented Jul 27, 2021

@pioneer2k hey, sorry for late reply, holidays 😅 I'm on it right now

@asyncapi-bot
Copy link
Contributor

🎉 This issue has been resolved in version 1.0.34 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@derberg
Copy link
Member

derberg commented Jul 28, 2021

@pioneer2k feel free to reopen if this release did not provide the fix

@pioneer2k
Copy link
Contributor Author

@derberg the fix still does not work for me

Run asyncapi/[email protected]
with:
template: @asyncapi/[email protected]
filepath: src/main/resources/asyncapi.yml
parameters: baseHref=/customer-context-asyncapi-generated-html/
output: asyncapi/customer-context-asyncapi-generated-html
env:
tf_version: 1.0.0
AWS_DEFAULT_REGION: eu-central-1
AWS_REGION: eu-central-1
AWS_ACCESS_KEY_ID: ***
AWS_SECRET_ACCESS_KEY: ***
AWS_SESSION_TOKEN: ***
JAVA_HOME: /opt/hostedtoolcache/Java_Zulu_jdk/11.0.10-9/x64
Error: Cannot find module '@npmcli/run-script'
Require stack:

  • /home/runner/work/_actions/asyncapi/github-action-for-generator/v1.0.34/dist/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15)
    at Function.Module._load (internal/modules/cjs/loader.js:690:27)
    at Module.require (internal/modules/cjs/loader.js:852:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.27352 (/home/runner/work/_actions/asyncapi/github-action-for-generator/v1.0.34/webpack:/github-action-for-generator/external "@npmcli/run-script":1:1)
    at nccwpck_require (/home/runner/work/_actions/asyncapi/github-action-for-generator/v1.0.34/webpack:/github-action-for-generator/webpack/bootstrap:21:1)
    at Object.9699 (/home/runner/work/_actions/asyncapi/github-action-for-generator/v1.0.34/webpack:/github-action-for-generator/node_modules/pacote/lib/dir.js:13:1)
    at nccwpck_require (/home/runner/work/_actions/asyncapi/github-action-for-generator/v1.0.34/webpack:/github-action-for-generator/webpack/bootstrap:21:1)
    at Object.97545 (/home/runner/work/_actions/asyncapi/github-action-for-generator/v1.0.34/webpack:/github-action-for-generator/node_modules/pacote/lib/git.js:4:1)
    at nccwpck_require (/home/runner/work/_actions/asyncapi/github-action-for-generator/v1.0.34/webpack:/github-action-for-generator/webpack/bootstrap:21:1)

@derberg derberg reopened this Jul 28, 2021
@derberg
Copy link
Member

derberg commented Jul 28, 2021

sorry for that, the issue is with ncc bundler that event though configured properly, doesn't bundle this one dependency in dist, or does it wrong. I'll try to find some solution, and if this won't work I'm afraid we will have to for the time being change the strategy for this GH Action and simply commit node-modules which is the last resort I want to avoid.

@derberg
Copy link
Member

derberg commented Jul 28, 2021

@pioneer2k I think I got it 🤞🏼 can you test it without releasing? instead of asyncapi/[email protected] do derberg/github-action-for-generator@78cd4aadcef34e287ba1e71210593b13bfb3fc7c

@pioneer2k
Copy link
Contributor Author

@derberg of course
With your test version I got another error

Run derberg/github-action-for-generator@78cd4aa
with:
template: @asyncapi/[email protected]
filepath: src/main/resources/asyncapi.yml
parameters: baseHref=/customer-context-asyncapi-generated-html/
output: asyncapi/customer-context-asyncapi-generated-html
env:
tf_version: 1.0.0
AWS_DEFAULT_REGION: eu-central-1
AWS_REGION: eu-central-1
AWS_ACCESS_KEY_ID: ***
AWS_SECRET_ACCESS_KEY: ***
AWS_SESSION_TOKEN: ***
JAVA_HOME: /opt/hostedtoolcache/Java_Zulu_jdk/11.0.10-9/x64
Error: Cannot find module 'read-package-json-fast'
Require stack:

  • /home/runner/work/_actions/derberg/github-action-for-generator/78cd4aadcef34e287ba1e71210593b13bfb3fc7c/node_modules/@npmcli/run-script/lib/run-script.js
  • /home/runner/work/_actions/derberg/github-action-for-generator/78cd4aadcef34e287ba1e71210593b13bfb3fc7c/dist/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15)
    at Function.Module._load (internal/modules/cjs/loader.js:690:27)
    at Module.require (internal/modules/cjs/loader.js:852:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object. (/home/runner/work/_actions/derberg/github-action-for-generator/78cd4aadcef34e287ba1e71210593b13bfb3fc7c/node_modules/@npmcli/run-script/lib/run-script.js:1:13)
    at Module._compile (internal/modules/cjs/loader.js:959:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Function.Module._load (internal/modules/cjs/loader.js:727:14)
    at Module.require (internal/modules/cjs/loader.js:852:19)

@derberg
Copy link
Member

derberg commented Jul 29, 2021

@pioneer2k oh yes 🤦🏼 I forgot how npm handles dependencies, of course by default they were not under node_modules/@npmcli/run-script. Please try again now, this time derberg/github-action-for-generator@8dbdbb14089bd86f747b3d53bcec3369a79e2195

@pioneer2k
Copy link
Contributor Author

@derberg and the next module

Run derberg/github-action-for-generator@8dbdbb1
Error: Cannot find module 'typescript'
Require stack:

  • /home/runner/work/_actions/derberg/github-action-for-generator/8dbdbb14089bd86f747b3d53bcec3369a79e2195/dist/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15)
    at Function.resolve (internal/modules/cjs/helpers.js:80:19)
    at loadCompiler (/home/runner/work/_actions/derberg/github-action-for-generator/8dbdbb14089bd86f747b3d53bcec3369a79e2195/webpack:/github-action-for-generator/node_modules/ts-node/dist/index.js:213:1)
    at create (/home/runner/work/_actions/derberg/github-action-for-generator/8dbdbb14089bd86f747b3d53bcec3369a79e2195/dist/index.js:240107:28)
    at Object.register (/home/runner/work/_actions/derberg/github-action-for-generator/8dbdbb14089bd86f747b3d53bcec3369a79e2195/dist/index.js:240078:21)
    at utils.registerTypeScript (/home/runner/work/_actions/derberg/github-action-for-generator/8dbdbb14089bd86f747b3d53bcec3369a79e2195/dist/index.js:10498:30)
    at Object.56814 (/home/runner/work/_actions/derberg/github-action-for-generator/8dbdbb14089bd86f747b3d53bcec3369a79e2195/webpack:/github-action-for-generator/node_modules/@asyncapi/generator/lib/generator.js:64:1)
    at nccwpck_require (/home/runner/work/_actions/derberg/github-action-for-generator/8dbdbb14089bd86f747b3d53bcec3369a79e2195/webpack:/github-action-for-generator/webpack/bootstrap:21:1)
    at /home/runner/work/_actions/derberg/github-action-for-generator/8dbdbb14089bd86f747b3d53bcec3369a79e2195/webpack:/github-action-for-generator/lib/index.js:2:1
    at /home/runner/work/_actions/derberg/github-action-for-generator/8dbdbb14089bd86f747b3d53bcec3369a79e2195/dist/index.js:261330:3

@derberg
Copy link
Member

derberg commented Aug 2, 2021

@pioneer2k we should be good now use derberg/github-action-for-generator@0409191c21f902c78418d2ea6dd9ea80a43f1e31. I tested it here and all seemed to be good

@pioneer2k
Copy link
Contributor Author

@derberg it seems to work now. Do you create a new release?

@derberg
Copy link
Member

derberg commented Aug 3, 2021

@pioneer2k 🥳

once I merge, 1.0.35 will be automatically released, proper comment added to this issue and issue closed

@asyncapi-bot
Copy link
Contributor

🎉 This issue has been resolved in version 1.0.35 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working released
Projects
None yet
3 participants