Skip to main content

Questions tagged [npm-ci]

npm ci is a command in the npm CLI that Installs a project with a clean slate. This command is similar to npm-install, except it’s meant to be used in automated environments. This tag should be used for questions specifically relating to the npm ci command, and not the npm install command.

Filter by
Sorted by
Tagged with
761 votes
9 answers
433k views

What is the difference between "npm install" and "npm ci"?

I'm working with continuous integration and discovered the npm ci command. I can't figure what the advantages are of using this command for my workflow. Is it faster? Does it make the test harder,...
DiaJos's user avatar
  • 11.3k
243 votes
5 answers
416k views

npm: When to use `--force` and `--legacy-peer-deps`

I'm trying to understand how recreating the node_modules directory for deployment works. We're using npm ci instead of npm install to ensure a clean slate during deployment. However, when we run it ...
Floating Sunfish's user avatar
93 votes
2 answers
78k views

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

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: Installs both devDependencies and ...
josh's user avatar
  • 9,388
52 votes
2 answers
27k views

pnpm equivalent command for npm ci

What is the equivalent command for npm ci in pnpm? According to the documentation for npm install: pnpm install is used to install all dependencies for a project. In a CI environment, installation ...
BuZZ-dEE's user avatar
  • 6,627
30 votes
6 answers
41k views

How I can skip installing optional dependencies by 'npm ci'?

How I can skip installing optional dependencies from package-lock.json by npm ci?
art201214's user avatar
  • 447
16 votes
2 answers
4k views

Using "npm ci" instead of "npm install" for deterministic project setup

Given a project where the package-lock.json is managed in source control with the goal that all developers on the team get exactly the same dependencies. From the documentation of npm I think ...
jbandi's user avatar
  • 18k
6 votes
3 answers
8k views

npm ci giving Conflicting peer dependency

I am trying to install the dependencies from docker file with command RUN npm ci. But I am getting the following error Conflicting peer dependencies. Fix the upstream dependency conflict, or retry ...
JN_newbie's user avatar
  • 5,902
6 votes
1 answer
8k views

GitHub action fails on npm ci

I have git action to run prettier(Code formatter). Below is the format.yml file of git action. name: Format code with prettier on: push: branches-ignore: - master jobs: format: runs-...
Nidhi Dadiya's user avatar
5 votes
1 answer
807 views

Did "npm install" become deterministic in npm 7?

Here https://github.blog/2021-02-02-npm-7-is-now-generally-available/ it's said: The lockfile v2 unlocks the ability to do deterministic and reproducible builds to produce a package tree. But I ...
RussCoder's user avatar
  • 979
4 votes
3 answers
4k views

npm ci fails in Github Action

I am working on a pipeline to install npm packages using GitHub Actions, I am getting this error: npm ERR! code EUSAGE npm ERR! npm ERR! The `npm ci` command can only install with an existing package-...
learner's user avatar
  • 81
4 votes
0 answers
5k views

couldn't run npm ci

node.js - v12.16.2 npm - 6.14.4 OS - windows 10 When I run npm ci i get error. The complete error log: npm WARN prepare removing existing node_modules/ before installation > [email protected] ...
Sai Krishnadas's user avatar
3 votes
2 answers
2k views

NPM prune after NPM ci

I have an innocent question :is there some interest to do a npm prune after a npm ci ? For me npm ci seems to be sufficient, no ? Thanks by advance
Hulkito Nol's user avatar
3 votes
1 answer
2k views

Azure Devops: The given cache key has changed in its resolved value between restore and save steps;

I am struggling with one warning which shows in Azure Devops. ##[warning]The given cache key has changed in its resolved value between restore and save steps; original key: npm|"Linux"|...
Józef Podlecki's user avatar
3 votes
0 answers
2k views

NPM audit not finding vulnerabilities

I have a CI service that runs npm audit on every build and notifies if there are high-risk vulnerabilities. The strange thing is when CI reports high vulnerabilities when I run npm audit locally, it ...
nrofis's user avatar
  • 9,487
3 votes
1 answer
389 views

When npm install/ci honors package-lock.json, is there any purpose of using tilde(~) and caret(^) in package.json?

In case an application has a package-lock.json or shripkwrap.json, both npm install/npm ci command would honor the dependencies versions (in package-lock.json or shripkwrap.json), what purpose would ...
mavHarsha's user avatar
  • 1,056
3 votes
0 answers
5k views

Running "npm ci" when building docker image is much slower

I tried to run npm ci command using the same package.json and package-lock.json files in three different environments: docker host machine - takes ~27s to complete inside a docker container - takes ~...
Pavels Ahmadulins's user avatar
2 votes
2 answers
2k views

npm ci not working on bitbucket pipeline?

I have a react-native project and I'm trying to use bitbucket pipeline to run the tests and export to expo. For that I tried to follow this article, but it fail with the following output : + npm ci ...
baraber's user avatar
  • 3,346
2 votes
0 answers
557 views

npm ci in Jenkins parallel pipeline

I've got a monorepo with roughly the following structure (npm modules): myProject |-base |-ui1 |-ui2 In the base module I have all the stuff combined which my ui1 and ui2 projects use commonly. I ...
nioe's user avatar
  • 816
2 votes
1 answer
2k views

npm ci command fails in GitHub actions when running on Node 16

I'm running npm ci on Node 16 in GitHub workflow actions and keep getting the following error: npm ERR! code E401 npm ERR! Incorrect or missing password. npm ERR! If you were trying to login, change ...
David Faizulaev's user avatar
1 vote
1 answer
2k views

Why "npm ci" removes node_modules / all packages?

Why npm ci removes the node_modules / all packages? If a node_modules is already present, it will be automatically removed before npm ci begins its install.
BuZZ-dEE's user avatar
  • 6,627
1 vote
0 answers
520 views

Lerna + npm packages - how do I run npm install of the build?

I've created a monorepo project with server/client/shared packages. I have an existing (large) project that I try to apply monorepo behavior to have common code between multiple projects. I'm using ...
Yoav Moran's user avatar
1 vote
1 answer
156 views

VS2017 not able to identify the command npm ci

Node version: 8.11.3 I checked out a solution. It includes package-lock.json. So, I am trying to run npm ci on the instance. Unfortunately, it is not working. I am getting the message: Usage: npm <...
NutsAndBolts's user avatar
1 vote
0 answers
98 views

Should .gitignore be modified to include ./node_modules/.package-lock.json (aka: lockfileVersion 3)?

This is a commonly asked question, but a little different this time. It seems the developers of Node.js have chosen to make NPM register the standard v2 package-lock.json in the project root (or ...
Solonotix's user avatar
  • 459
1 vote
0 answers
377 views

'npm ci' command is not working as expected

I have installed a library with version 1.0.0 and then I have modified package.json file with version 1.0.3 and then I run "npm ci" and expecting it should not update the package as it ...
Abasaheb Gaware's user avatar
1 vote
1 answer
393 views

Adonis npm ci --production hangs

I have problem when deploying an Adonis project, After building, adonis suggest to do npm ci --production inside build folder. And after I do npm ci --production, the process is hangs extractTree: ...
sigit nurmajid's user avatar
1 vote
0 answers
127 views

How do you deploy a continuous running app when using npm-cli

I have a largish nodejs based web app, with both server and client components working together. I am currently deploying the app, but using git pull to take my latest production branch from the ...
akc42's user avatar
  • 4,939
0 votes
1 answer
23 views

401 Unauthorized - authentication token not provided, GitHub npm

I have to download a package from my-org with GitHub actions for Node projects. I have an action like this to make an .npmrc file: > ${{ inputs.npmrc_path }} echo "@my-org:registry=https://npm....
Isabel Roman's user avatar
0 votes
0 answers
31 views

Getting npm permission error when doing npm ci on windows self hosted runner

I am working on a github action where I have to install dependencies using npm ci command. I am using a self-hosted windows runner. Here's my github action: name: test build on: workflow_dispatch: ...
pogbamessi's user avatar
0 votes
1 answer
105 views

npm ci is failing intermittently with "error cb() never called!" [email protected] and [email protected]

We have a few build pipelines that are failing intermittently with "error cb() never called!" for npm ci. This error is displayed after it downloaded and extract a random npm package (in ...
Mahesh's user avatar
  • 410
0 votes
0 answers
1k views

React App wont run using npm run dev, by use of concurrently

I am working on a React app that I just pulled down from Github. I ran an npm ci once pulled down and opened the project hoping it would run. I'm getting an error when I am trying to run the client ...
Sam's user avatar
  • 88
0 votes
1 answer
270 views

Vue-CLI project automatic deployment on Firebase Hosting using GitHub actions

So I am having my Vue-CLI project and I can't manage automatic deployments. I've been googling all day, I got the key from firebase login:ci but I don't understand where am I supposed to place it ...
Mike K.'s user avatar
  • 653
0 votes
1 answer
2k views

Bypass NPM cache, if the module that I'm looking for is not there

While working with NPM and its cache, I noticed that -sometimes- when the newest version of a certain package is not in the cache, npm ci errors out without bypassing NPM cache. Is there a way to tell ...
Guillermo's user avatar
  • 1,513
0 votes
0 answers
613 views

Gitlab CI - caching Node.js dependencies

I'm having significant problems trying to reuse the packages installed with npm ci between jobs. I have been following this documentation: https://docs.gitlab.com/ee/ci/caching/#cache-nodejs-...
Ben K's user avatar
  • 33
-1 votes
1 answer
45 views

Installing freeCodecamp locally hangs when I get to the npm ci step

I've been trying to install freeCodeCamp repo locally coz I'm doing the Full-stack curriculum and I am in a remote area where the grid is not reliable. I've got the repo on my compute already. I've ...
Lidhiwa's user avatar