Is there a way of making “npm ci” install devDependencies, or “npm install” not update package-lock.json?

后端 未结 2 1264
旧时难觅i
旧时难觅i 2021-02-20 01:05

I\'m trying to put together documentation for new developers installing our codebase on their local development environments. I\'d like to give them command(s) that:

2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-20 01:21

    npm ci does install both dependecies and dev dependencies. But if you use npm ci --production or if your NODE_ENV is set to production, then it avoids installing dev dependencies. Please check docs here.

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

    NOTE: The --production flag has no particular meaning when adding a dependency to a project.

提交回复
热议问题