npm audit - ELOCKVERIFY error with local dependencies

(Jeremy Craig Martinez) #1

What I Wanted to Do

Have a local dependency in my package.json and run npm audit.

What Happened Instead

$ npm audit
npm ERR! code ELOCKVERIFY
npm ERR! Errors were found in your package-lock.json, run npm install to fix them.
npm ERR! Missing: ajv@file:../

Reproduction Steps

in $PWD (root dir) add a package.json like the following:

{
  "name": "bat-apps",
  "dependencies": {
    "ajv": "^6.7.0"
  }
}

mkdir sub-module
cd sub-module/
in $PWD/sub-module/ add a package.json like the following:

{
  "name": "bat-apps",
  "dependencies": {
    "ajv": "file:../"
  }
}

run installs and audits

cd $PWD # (root dir)
npm i 
cd $PWD/sub-module
npm i 
npm audit # expecting this to pass but it fails

Details

N/A

Platform Info

$ node -v
v10.15.3
$ npm -v
6.4.1
$ node -p process.platform
darwin
0 Likes

(John Gee) #2

Looks like a duplicate of: `npm audit` fails to audit packages with a local dependency in npm v6.9.0

0 Likes