Questions tagged [package-lock.json]
224 questions
12
votes
0 answers
NPM - How do I override one of my dependencies dependency?
Recently, npm released the npm audit command. It runs automatically when you npm i letting you know of any vulnerabilities. I have a simple dependency tree, something like this:
package A
package B
package B dependency
package C
My package.json…

The Qodesmith
- 3,205
- 4
- 32
- 45
11
votes
2 answers
What would cause lockfileVersion in package-lock.json to decrease by one?
Bumped the patch version in a package.json (manually, edited file). Noted that the lock file had the old version, so I did an npm install to update it. When I did that the lockfileVersion field went from 2 to 1. This seems odd. The docs about…

jcollum
- 43,623
- 55
- 191
- 321
11
votes
3 answers
Running `npm ci` returns `pkg-dir not accessible from find-cache-dir`
I'm trying to run this command:
npm ci
And it returns this error:
npm ERR! pkg-dir not accessible from find-cache-dir
What am I missing here?

craftsman
- 15,133
- 17
- 70
- 86
11
votes
1 answer
Why does "npm install" modify package-lock.json? Why commit it to git then?
When I run "npm install" in a project it often modifies package-lock.json, for example if I work on the same project from another computer (with different node or npm version).
But at the same time the documentation suggests that the file is…

szx
- 6,433
- 6
- 46
- 67
11
votes
1 answer
What does "requires: true" do in package-lock.json
Our team just updated to npm@5. The package-lock.json was unified between Windows and Mac (certain dependencies are optional so they don't get installed on Windows, but they do on Mac) so that no matter the machine, we'd generate the same…

atdrago
- 295
- 4
- 16
10
votes
4 answers
Okay to Paste-in Package-Lock.json from 19 Hours Ago to Fix "ValidationError: Progress Plugin Invalid Options" (Vue 3)?
I'm using Vue 3 and I pushed a version of my project that was working well to GitHub 19 hours ago.
About 5 hours later, the problem below occurred when I entered npm run serve which resulted in these lines of information:
> zagnetic@0.1.0 serve
>…

Mark Gavagan
- 878
- 12
- 45
10
votes
0 answers
How to generate per-package package-lock.json for existing Lerna mono-repo
We have an existing Lerna mono-repo that has a structure like:
/
/packages
/package1
/package2
/package3
...
We currently use Yarn for our project, and actually only have a top-level yarn.lock file, with no per-package yarn.lock…

Matthew Herbst
- 29,477
- 23
- 85
- 128
10
votes
1 answer
Updating transitive dependencies of a NPM package
Our company has a few web applications which in turn depend on a very long chain of internally created and hosted npm packages (we use JFrog Artifactory) each with their own dependencies (and so on). Whenever a bug is fixed or a feature is…

PremiumTier
- 173
- 1
- 13
9
votes
1 answer
npm install changes resolved from a URL to false
The Problem
When I pull my team's code and run npm install a number of items in package-lock.json have their resolved property change from a URL to false. E.g.
"debug": {
"version": "3.2.6",
"resolved":…

Aaron
- 13,349
- 11
- 66
- 105
9
votes
1 answer
Difference between `npm update` and `remove package-lock.json` plus `npm install`?
What is essential difference between these commands, except that npm update modify package.json?
rm package-lock.json
npm install
npm update --dev

yakunins
- 636
- 1
- 9
- 18
9
votes
1 answer
Lerna not generating package-lock.json for every package
Below is the description of the issue:-
Expected behaviour is to have a package-lock.json file generated for every package in packages folder.
Current Behaviour
My current project structure look…

Vishesh
- 3,599
- 4
- 22
- 36
9
votes
3 answers
How do you bump a transitive dependency in package-lock.json
My project depends on analytics-node which has a dependency on axios: "^0.16.2".
We have been flagged with npm audit that axios has a vulnerability in it but its fixed in 0.18.1.
However, analytics-node has no release candidate (only beta) which…

Dave
- 131
- 1
- 6
9
votes
2 answers
No effect when doing git diff -- ':(exclude)package-lock.json'
I want to a do a diff but without package-lock.json which is huge and is a generated file so nothing interesting for me there.
I tried both :
git diff -- ':(exclude)package-lock.json'
git diff -- ':!package-lock.json'
but it has just zero output.…

Olivvv
- 1,140
- 1
- 13
- 37
8
votes
1 answer
How to manually confirm integrity field in package-lock.json file?
What commands could I run to manually generate (or confirm) the integrity field contained in a package-lock.json file?
Here's an example with SHA1:
"uglify-js": {
"version": "2.8.29",
"resolved":…

TTT
- 22,611
- 8
- 63
- 69
8
votes
1 answer
Is there a tool to validate/check that package.json and package-lock.json are consistent?
Sometimes people change package.json and forget to run npm i which will update package-lock.json, or package.json and package-lock.json are otherwise out of sync. This is an assumption not to be discussed/questioned here. I am looking for a tool…

Lorenz Leutgeb
- 474
- 6
- 12