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

Error: Cannot find module 'tunnel' in @actions/github@5.0.2 #1083

Closed
akphi opened this issue May 12, 2022 · 4 comments
Closed

Error: Cannot find module 'tunnel' in @actions/github@5.0.2 #1083

akphi opened this issue May 12, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@akphi
Copy link

akphi commented May 12, 2022

Describe the bug
In the latest version of @actions/github 5.0.2, we got the following error in our pipeline

node:internal/modules/cjs/loader:933
  const err = new Error(message);
              ^

Error: Cannot find module 'tunnel'
Require stack:
- /home/runner/work/legend-studio/legend-studio/node_modules/@actions/http-client/lib/index.js
- /home/runner/work/legend-studio/legend-studio/node_modules/@actions/core/lib/oidc-utils.js
- /home/runner/work/legend-studio/legend-studio/node_modules/@actions/core/lib/core.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
...

To Reproduce

This is our repo
https://github.com/finos/legend-studio/runs/6414726076?check_suite_focus=true

Expected behavior

I think this happens because we use Yarn to install dependencies and we got a problem with Yarn not installing tunnel because it is a devDependency of http-client, but in fact, tunnel should be a runtime dependency of http-client.

I believe the workaround from our end is not so complicated - just manually installing tunnel, but could we make this a dependency instead?

Thank you so much!

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@alice-was-here
Copy link

We've woken up to a similar issue this morning in our CI/CD pipeline. A quick fix if you're using @actions/core is to pin it to the previous version, e.g.: npm i @actions/core@1.8.0.

@arminrosu
Copy link

not installing tunnel because it is a devDependency of http-client, but in fact, tunnel should be a runtime dependency of http-client.

I believe the workaround from our end is not so complicated - just manually installing tunnel, but could we make this a dependency instead?

Looks like when actions/http-client was merged into actions/toolkit in #1062 the tunnel dependency was changed to a devDependency. That's when @actions/http-client@2.0.0 and @actions/core@1.8.1 were released. Likely an oversight.

mikepenz added a commit to mikepenz/release-changelog-builder-action that referenced this issue May 13, 2022
```
    "@actions/core": "^1.8.1",
    "@actions/github": "^5.0.2",
    "moment": "^2.29.3",
    "tunnel": "^0.0.6", <-- temporarily until actions/toolkit#1083 is fixed
    "webpack": "^5.72.1"
    "@types/jest": "^27.5.1",
    "@types/node": "^17.0.33",
    "@typescript-eslint/parser": "^5.23.0",
    "eslint": "^8.15.0",
    "eslint-plugin-jest": "^26.1.5",
    "jest": "^28.1.0",
    "jest-circus": "^28.1.0",
    "ts-jest": "^28.0.2",
    "typescript": "^4.6.4"
```
@karlhorky
Copy link

karlhorky commented May 13, 2022

Seems like @gfx opened #1084 to fix this, 👀 watching over there now

@konradpabjan
Copy link
Contributor

This should now be resolved, @actions/http-client was bumped up to v2.0.1 with a fix for the tunel dependency.

I've gone ahead and updated and released new versions of all other packages that use it:

  • @actions/artifact -> 1.0.2
  • @actions/cache -> 2.0.4
  • @actions/core -> 1.8.2
  • @actions/github -> 5.0.3
  • @actions/tool-cache -> 2.0.1

JZYNX added a commit to JZYNX/Elevate. that referenced this issue Sep 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants