Skip to content

Commit 1c27f3c

Browse files
committed
fix: update buildspec to show installed node version
1 parent c12901a commit 1c27f3c

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,18 @@ To create the CodeBuild project please follow these steps:
7575
6. Leave the _Build specification_ on "Use a buildspec file".
7676
7. No batch configuration is needed.
7777

78+
Frequent errors:
79+
80+
- **`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.`**
81+
82+
Troubleshooting:
83+
84+
1. Please check the error log for the specific Node version the build environment uses. (e.g. v18.6.0).
85+
2. On your local environment please install the exact same version of node with `nvm install vX.X.X`. After the installation check the currently used version with the `node -v` command. If it doesn't match the just installed version run the following command: `nvm use vX.X.X`.
86+
3. Delete the `package-lock.json` file.
87+
4. Run `npm install` :warning: **twice** :warning:!
88+
5. Push the updated `package-lock.json` and rerun the CodeBuild.
89+
7890
## S3 (e.g., [email protected])
7991

8092
A different S3 bucket is created for each environment. Public access is enabled on these buckets, which are configured for static website hosting.

buildspec.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ phases:
44
runtime-versions:
55
nodejs: 18
66
commands:
7-
- echo "Node version 18 installed"
7+
- echo "Node version $(node -v) installed"
88
- echo "Installing source NPM dependencies..."
99
- npm ci
1010

0 commit comments

Comments
 (0)