npm WARN old lockfile
npm WARN old lockfile The package-lock.json file was created with an old version of npm
There are several ways to deal with this:
- Ignore it. It’s just a warning and does not affect the installation of modules.
npm cito make sure your
node_modulesreflects the lock file, then remove
package-lock.json, and then run
npm install(with the newer version of
npm) to regenerate a
package-lock.json. Because everything in
node_moduleswill meet all the requirements, the only change from
npm installwill be a newly-generated
package-lock.jsonfile. Commit the updated version of
package-lock.jsonto the repo/Docker image or whatever.
npmto an older version in production. Consider running
npmversion 6 as that is what ships with the current (as of this writing) LTS version of Node.js. In the case being asked about in this question, I imagine you can just leave out the
RUN npm -g install firstname.lastname@example.org the Dockerfile and instead use the version of
npmthat is installed with the Docker image (which in this case will almost certainly be
npm@6since that is what ships with Node.js 14.x).
- If you want to run one command with an older […]