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

Cannot require global packages #275

Open
artyom-melnikov opened this issue Jul 19, 2022 · 3 comments
Open

Cannot require global packages #275

artyom-melnikov opened this issue Jul 19, 2022 · 3 comments

Comments

@artyom-melnikov
Copy link

I've installed npm package globally and I cannot require it from the github script

Error: Cannot find module 'xxx'
Require stack:
- /home/runner/work/_actions/actions/github-script/v6/dist/index.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at resolve (node:internal/modules/cjs/helpers:108:19)
    at Object.apply (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:4822:43)
    at eval (eval at callAsyncFunction (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:4807:16), <anonymous>:3:29)
    at callAsyncFunction (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:4808:12)
    at main (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:4862:26)
    at Module.272 (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:4846:1)
    at __webpack_require__ (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:[24]
    at startup (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:43:19)
    at /home/runner/work/_actions/actions/github-script/v6/dist/index.js:49:18 {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/runner/work/_actions/actions/github-script/v6/dist/index.js'
  ]
}

I also tried to change NPM_CONFIG_PREFIX but it didn't help as well

@ShaMan123
Copy link

+1

@rgoodwin
Copy link

Is there any update on this. I am encountering the same issue.

@SvenSchneiderDVAG
Copy link

SvenSchneiderDVAG commented Jan 15, 2024

Same issue here with version 7 on Windows 11. installed joi with npm install -g joi

Run actions/github-script@v7
Error: Cannot find module 'joi'
Require stack:
- C:\actions-runner\_work\_actions\actions\github-script\v7\dist\index.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1048:15)
    at resolve (node:internal/modules/helpers:136:19)
    at Object.apply (C:\actions-runner\_work\_actions\actions\github-script\v7\dist\index.js:[35](https://github.com/dvag/gitrxspielwiese/actions/runs/7526587621/job/20485294576#step:4:36)469:43)
    at eval (eval at callAsyncFunction (C:\actions-runner\_work\_actions\actions\github-script\v7\dist\index.js:35424:16), <anonymous>:3:13)
    at callAsyncFunction (C:\actions-runner\_work\_actions\actions\github-script\v7\dist\index.js:35425:12)
    at main (C:\actions-runner\_work\_actions\actions\github-script\v7\dist\index.js:35522:26)
    at C:\actions-runner\_work\_actions\actions\github-script\v7\dist\index.js:35497:1
    at C:\actions-runner\_work\_actions\actions\github-script\v7\dist\index.js:35553:3
    at Object.<anonymous> (C:\actions-runner\_work\_actions\actions\github-script\v7\dist\index.js:35556:12)
    at Module._compile (node:internal/modules/cjs/loader:12[41](https://github.com/dvag/gitrxspielwiese/actions/runs/7526587621/job/20485294576#step:4:42):14) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\actions-runner\\_work\\_actions\\actions\\github-script\\v7\\dist\\index.js'
  ]
}
Error: Unhandled error: Error: Cannot find module 'joi'
Require stack:
- C:\actions-runner\_work\_actions\actions\github-script\v7\dist\index.js

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

4 participants