By nickoleary
When I try deploying my node.js app with a package-lock.json file, it fails with the error:
flow-library | 09:58:09 Installing node_modules using npm
flow-library | 09:58:12 npm ERR! cipm can only install packages with an existing package-lock.json or npm-shrinkwrap.json with lockfileVersion >= 1. Run an install with npm@5 or later to generate it, then try again.
flow-library | 09:58:12
flow-library | 09:58:12 npm ERR! A complete log of this run can be found in:
flow-library | 09:58:12 npm ERR! /home/apps/.npm/_logs/2020-11-12T09_58_12_025Z-debug.log
When I switch over to included a yarn.lock file - the deploy works. I would prefer to stick with npm as that’s what we’re using through-out our project.
Any ideas when cipm complains about the lack of package-lock.json when it definitely exists?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hello @nickoleary
It appears the commit in that package-lock.json file was missing so you were seeing that npm error. You might have to run npm install and commit the package-lock.json file. Both the NPM and Yarn package managers are supported, however, either package-lock.json for NPM projects or yarn.lock for Yarn projects must be committed to the repo alongside the app’s source code.
We have already documented this under limitation: https://www.digitalocean.com/docs/app-platform/languages-frameworks/node/
Tip: When submitting any questions related to App Platform please add the tag “DigitalOcean App Platform” which will filter the community questions to App Platform Specialists.
Cheers,
Dikshith
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.