Azure / docker-login

GitHub action to log in to Azure Container Registry (ACR) or any private container registry
MIT License
108 stars 48 forks source link

Error: Cannot find module '@actions/core' #68

Closed joshmedeski closed 3 months ago

joshmedeski commented 3 months ago

When I upgraded to v2, I got the following error:

Run azure/docker-login@v2
  with:
    login-server: ***
    username: ***
    password: ***
node:internal/modules/cjs/loader:1051
  throw err;
  ^

Error: Cannot find module '@actions/core'
Require stack:
- /home/runner/work/_actions/azure/docker-login/v[2](https://github.com/Nutiliti/nutiliti/actions/runs/9181416347/job/25248134779#step:4:2)/lib/login.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1048:15)
    at Module._load (node:internal/modules/cjs/loader:901:27)
    at Module.require (node:internal/modules/cjs/loader:1115:19)
    at require (node:internal/modules/helpers:1[3](https://github.com/Nutiliti/nutiliti/actions/runs/9181416347/job/25248134779#step:4:3)0:18)
    at Object.<anonymous> (/home/runner/work/_actions/azure/docker-login/v2/lib/login.js:13:1[4](https://github.com/Nutiliti/nutiliti/actions/runs/9181416347/job/25248134779#step:4:4))
    at Module._compile (node:internal/modules/cjs/loader:1241:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:129[5](https://github.com/Nutiliti/nutiliti/actions/runs/9181416347/job/25248134779#step:4:5):10)
    at Module.load (node:internal/modules/cjs/loader:1091:32)
    at Module._load (node:internal/modules/cjs/loader:93[8](https://github.com/Nutiliti/nutiliti/actions/runs/9181416347/job/25248134779#step:4:9):12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:[12](https://github.com/Nutiliti/nutiliti/actions/runs/9181416347/job/25248134779#step:4:13)) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/home/runner/work/_actions/azure/docker-login/v2/lib/login.js' ]
}

Node.js v20.8.1

Perhaps something wasn't built successfully on the recent release.

lgmorand commented 3 months ago

That's weird because the PR I approved should not require any rebuild. I found more issues 1- the workflow doing unit testing says OK while it fails internally 2- I can't push a new branch to SSO specific configuration. it says that I have to reauth Visual Studio which I'm not using

I did a fork, but instead of just doing the rebuild, I upgraded the npm packagez. it should fix the known vulnerabilities and maybe fix some open issues. The problem is that it could bring to new bugs too. Since I can't create a branch here, could you please test this version: https://github.com/lgmorand/docker-login

lgmorand/docker-login@master

if some people (@joshmedeski @valimail-scott) can confirm it works for them before I do a PR. Thanks

lgmorand commented 3 months ago

shoot. it does not work. I even tried to rebuild the TS but it does not change anything

looks like node_modules have be missing. I'm looking when they have been removed

lgmorand commented 3 months ago

Looks fine on my side with added node_modules. What I don't understand is that I don't see them in this repo before the merge from yesterday.

anyway. please confirm that the fork works with you and I'll continue the merge and recreate the v2 release. thanks

joshmedeski commented 3 months ago

I got this error when trying to test your fork. I'm not sure if master is supported:

Error: Unable to resolve action lgmorand/test-docker-login@master, unable to find version master

larskristianhaga commented 3 months ago

Have the exact same issue when upgrading azure/docker-login from v1 to v2.

lgmorand commented 3 months ago

you have to test "lgmorand/docker-login@master" (see yaml file), not lgmorand/test-docker-login@master (which is a test repo to call the "forked" action. Normally it should work but since there are so many configurations possible, I'd love to have some people to test it first

with github actions, you can reference a tag, a branch or a commit.

lgmorand commented 3 months ago

Have the exact same issue when upgrading azure/docker-login from v1 to v2.

sure but did you test the forked one I put in the comments ? it would help a lot. thanks :)

joshmedeski commented 3 months ago

Thanks for clarifying, the fork is working for me!

lgmorand commented 3 months ago

I recreated the tag v2 and the release. Closing the issue for now. don't hesitate for reopen an issue (or do a PR) if someone finds an issue