Cannot install relative filesystem package after package-lock has been generated

What I Wanted to Do

I have an example folder inside my repository, which installs the package from the parent directory via npm install ...

This has generally worked fine, but I have recently noticed that trying to run npm install from the example no longer works.

What Happened Instead

Error:

npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename ‘/Users/glen/Development/GitHub/glenjamin/npm-lock-bug/example/node_modules/.staging/npm-lock-bug-c02b14f3/node_modules/ajv’ -> ‘/Users/glen/Development/GitHub/glenjamin/npm-lock-bug/example/node_modules/.staging/ajv-d8b09fad’
npm ERR! enoent This is related to npm not being able to find a file.

Reproduction Steps

mkdir npm-lock-bug
cd npm-lock-bug
npm init
npm i request
mkdir example
cd example
npm init
npm i ..
rm -rf node_modules
npm i

# install will continue to fail unless I do
rm package-lock.json
npm i

Details

Platform Info

$ npm --versions
{ example: '1.0.0',
  npm: '6.4.1',
  ares: '1.14.0',
  cldr: '33.1',
  http_parser: '2.8.0',
  icu: '62.1',
  modules: '64',
  napi: '3',
  nghttp2: '1.34.0',
  node: '10.13.0',
  openssl: '1.1.0i',
  tz: '2018e',
  unicode: '11.0',
  uv: '1.23.2',
  v8: '6.8.275.32-node.36',
  zlib: '1.2.11' }
$ node -p process.platform
darwin

Looks related:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.