aws-codebuild-run-build
aws-codebuild-run-build copied to clipboard
Running locally with npx fails "404 Not Found"
The README doc describe running locally using npx. https://github.com/aws-actions/aws-codebuild-run-build/blob/main/README.md#running-locally
The command will fail as the package is not published to the NPM Package Registry, npmjs.org.
Error:
$ npx @aws-actions/codebuild-run-build -p ProjectName -r remoteName
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@aws-actions%2fcodebuild-run-build - Not found
npm ERR! 404
npm ERR! 404 '@aws-actions/codebuild-run-build@latest' is not in this registry.
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
Are the docs correct?
I hit this issue too, I ended up installing using yarn and the url for the repo to get around it:
yarn add https://github.com/aws-actions/aws-codebuild-run-build
OR
npm install https://github.com/aws-actions/aws-codebuild-run-build
Even then, I encountered an issue where using an SSH git remote does not work:
npx @aws-actions/codebuild-run-build -p ci-cd-fargate
ci-cd-fargate/node_modules/@aws-actions/codebuild-run-build/local.js:147
throw new Error(`Unsupported format: ${url}`);
^
Error: Unsupported format: git@<private-git-server-redacted>:ORG/ci-cd-fargate.git
at githubInfo (ci-cd-fargate/node_modules/@aws-actions/codebuild-run-build/local.js:147:11)
at Object.<anonymous> (ci-cd-fargate/node_modules/@aws-actions/codebuild-run-build/local.js:85:6)
at Module._compile (node:internal/modules/cjs/loader:1356:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:128:12)
at node:internal/main/run_main_module:28:49
Node.js v18.19.1
Working workaround
npm install [email protected]:aws-actions/aws-codebuild-run-build.git
npx @aws-actions/codebuild-run-build --help
Thanks @ChrisFichman for the hint 👍