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.

Reference:

19 questions
332
votes
6 answers

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, okay, and after?
Webwoman
  • 5,914
  • 7
  • 26
  • 67
28
votes
2 answers

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

I'm new to npm and am 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 without any flags, we get the…
Floating Sunfish
  • 1,442
  • 3
  • 15
  • 30
20
votes
2 answers

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 dependencies based on the versions in…
josh
  • 7,480
  • 7
  • 28
  • 33
19
votes
3 answers

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
  • 337
  • 2
  • 10
7
votes
0 answers

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 developers should use npm ci to set up their development…
jbandi
  • 14,967
  • 8
  • 62
  • 75
3
votes
0 answers

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 > fsevents@1.2.4 install G:\Agrima\workspace\VoTT\node_modules\fsevents >…
Sai Krishnadas
  • 843
  • 1
  • 9
  • 32
2
votes
0 answers

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 use npm local paths to add the base module as a…
nioe
  • 516
  • 1
  • 3
  • 11
2
votes
0 answers

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 ~32s to complete during building a docker image -…
2
votes
2 answers

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 npm ERR! path git npm ERR! code ENOENT npm ERR!…
baraber
  • 3,086
  • 25
  • 41
1
vote
0 answers

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 says found 0 vulnerabilities. It will find the…
nrofis
  • 7,124
  • 9
  • 44
  • 90
1
vote
0 answers

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 server repository. A git post-commit hook runs to do…
akc42
  • 4,447
  • 5
  • 36
  • 54
0
votes
0 answers

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 wonder is it the default behavior now for npm 7? That…
RussCoder
  • 457
  • 4
  • 12
0
votes
1 answer

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 NPM something like "If the package you're…
Guillermo
  • 1,453
  • 3
  • 15
  • 29
0
votes
0 answers

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-dependencies, but the packages are reinstalled each step…
Ben K
  • 11
  • 1
0
votes
0 answers

why do we require node-sass package? is there any substitute for the same?

I am trying to make a jenkins build happen and helping a developer. the job is npm based appstatic build job that has the unit testing and e2e testing stages. the unit test requires the npm rebuild node-sass command, which is giving the following…
AM007
  • 21
  • 5
1
2