-
Node.js Version Incompatibility
- Some packages require Node.js v20+ or v22+
- Build environment was using Node.js v18.20.6
- Affected packages: path-scurry@2.0.0, minimatch@10.0.1
-
Missing Build Script
- The build process was trying to run
npm run build:backend - This script doesn't exist in package.json
- The build process was trying to run
-
Package Access Issues
- 403 Forbidden errors when trying to download npm packages
- Specifically for camelcase@6.3.0 and camel-case@4.1.2
-
AWS Amplify Deprecation Warnings
- Multiple @aws-amplify/* packages showed deprecation warnings
- Message: "backend-cli 1.6.0 does not work with Amplify Hosting service"
-
Build Configuration Alignment
- Synchronized package.json and amplify.yml with main branch
- Using standard Amplify build configuration with npm ci
- Removed custom build:backend script
-
Dependency Management
- Using npm ci with cache for faster, more reliable builds
- Using --prefer-offline flag to prioritize cached packages
- Properly configured cache paths for node_modules and .npm
-
Version Pinning
- Use exact versions for critical dependencies
- Consider using package locks for consistent installations
-
Regular Updates
- Run
npm auditregularly to check for vulnerabilities - Use
npm updateto keep dependencies current - Consider automated dependency updates with tools like Dependabot
- Run
-
Build Environment Consistency
- Use
.nvmrcor similar to specify Node.js version - Document environment requirements in README
- Consider containerization for complete environment control
- Use
-
Amplify-Specific Recommendations
- Keep Amplify CLI versions aligned with Amplify Hosting requirements
- Test locally before deploying to catch compatibility issues
- Review Amplify documentation for version compatibility guidance