npmpackage.json

What is `"dev" true` in package-lock.json for?


What does "dev" true means in package-lock.json file?

In my case it is automatically updated when I perform npm operations.

How can we remove it?


Solution

  • So answering your first question, "dev": true in package-lock.json means this dependency won't be installed by npm install/npm ci when running in production mode.

    Having dependencies used only for local development environment marked with "dev": true and then using --production in your CI might save you some build time.

    From documentation https://docs.npmjs.com/cli/install#description:

    By default, npm install will install all modules listed as dependencies in package.json.

    With the --production flag (or when the NODE_ENV environment variable is set to production), npm will not install modules listed in devDependencies.