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

CodePipeline の Build にてエラーが発生しました。 #53

Closed
koichimurakami opened this issue Nov 17, 2024 · 3 comments
Closed

Comments

@koichimurakami
Copy link
Contributor

プロジェクトを作成し、AWS側の設定を実施後CDKにてデプロイを開始したら下記エラーメッセージが発生しました。

[Container] 2024/11/17 07:05:09.022645 Running command npm --prefix ./infra ci
npm error code EUSAGE
npm error
npm error `npm ci` can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with `npm install` before continuing.
npm error
npm error Missing: [email protected] from lock file
npm error Missing: [email protected] from lock file
npm error Missing: [email protected] from lock file
npm error Missing: [email protected] from lock file
npm error Missing: [email protected] from lock file
npm error Missing: [email protected] from lock file
npm error Missing: [email protected] from lock file
npm error Missing: [email protected] from lock file
npm error Missing: [email protected] from lock file
npm error Missing: [email protected] from lock file
npm error Missing: [email protected] from lock file
npm error Missing: [email protected] from lock file
npm error Missing: [email protected] from lock file
npm error Missing: [email protected] from lock file
npm error Missing: [email protected] from lock file
npm error Missing: [email protected] from lock file
npm error Missing: [email protected] from lock file
npm error Missing: [email protected] from lock file
npm error Missing: [email protected] from lock file
npm error Missing: [email protected] from lock file
npm error Missing: [email protected] from lock file
npm error Missing: [email protected] from lock file
npm error
npm error Clean install a project
npm error
npm error Usage:
npm error npm ci
npm error
npm error Options:
npm error [--install-strategy <hoisted|nested|shallow|linked>] [--legacy-bundling]
npm error [--global-style] [--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]]
npm error [--include <prod|dev|optional|peer> [--include <prod|dev|optional|peer> ...]]
npm error [--strict-peer-deps] [--foreground-scripts] [--ignore-scripts] [--no-audit]
npm error [--no-bin-links] [--no-fund] [--dry-run]
npm error [-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
npm error [-ws|--workspaces] [--include-workspace-root] [--install-links]
npm error
npm error aliases: clean-install, ic, install-clean, isntall-clean
npm error
npm error Run "npm help ci" for more info

npm error A complete log of this run can be found in: /root/.npm/_logs/2024-11-17T07_05_09_102Z-debug-0.log

[Container] 2024/11/17 07:05:12.947097 Command did not exit successfully npm --prefix ./infra ci exit status 1
[Container] 2024/11/17 07:05:12.949913 Phase complete: INSTALL State: FAILED
[Container] 2024/11/17 07:05:12.949930 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: npm --prefix ./infra ci. Reason: exit status 1
@baquan1708
Copy link
Collaborator

baquan1708 commented Nov 18, 2024

@koichimurakami
I believe the error may be due to the absence of a package-lock.json file in the infra folder.

There should be package-lock.json files in both the root and infra folder for installation. Please check whether these files exist and ensure they are committed to the origin repository. Once this is done, the pipeline should work successfully.

Kindly let me know the result after applying the above solution.

@baquan1708
Copy link
Collaborator

@koichimurakami
After further investigation, I discovered that the error occurs when we use @aws/pdk to be used with npm. The issue has not yet been resolved with npm ci: aws/aws-pdk#755 . However, as recommended, we can use pnpm instead of npm, which resolves the above error.

I will update the template to fix this issue.

@koichimurakami
Copy link
Contributor Author

@baquan1708
Thank you.
It has been solved.

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

2 participants