npm ci and local packages issue

cli
help-wanted
priority:medium
triaged

(Jon Wallsten) #1

What I Wanted to Do

I want to run “npm ci” without any errors just like i run “npm install”

What Happened Instead

Symlinks are not setup correctly and throws error that the source folder exists already.

Reproduction Steps

Set up a monorepo with packages dependent on each other.
Add local packages as dependecies in package.json with a local path (file:…/another-repo)

Details

297 verbose stack Error: EEXIST: file already exists, symlink 'C:\Users\me\repo\project\packages\lib-core' -> 'C:\Users\me\repo\project\packages\app\node_modules\@company\lib-angular\node_modules\@company\lib-common\node_modules\@company\lib-core'
298 verbose cwd C:\Users\me\repo\project\packages\app
299 verbose Windows_NT 10.0.16299
300 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "ci"
301 verbose node v10.9.0
302 verbose npm  v6.2.0
303 error path C:\Users\me\repo\project\packages\lib-core
304 error code EEXIST
305 error errno -4075
306 error syscall symlink
307 error EEXIST: file already exists, symlink 'C:\Users\me\repo\project\packages\lib-core' -> 'C:\Users\me\repo\project\packages\app\node_modules\@company\lib-angular\node_modules\@company\lib-common\node_modules\@company\lib-core'
308 error File exists: C:\Users\me\repo\project\packages\lib-core
309 error Move it away, and try again.
310 verbose exit [ -4075, true ]

Platform Info

$ npm --versions
{ 'oas-web-src': '5.0.108',
  npm: '6.2.0',
  ares: '1.14.0',
  cldr: '33.1',
  http_parser: '2.8.0',
  icu: '62.1',
  modules: '64',
  napi: '3',
  nghttp2: '1.32.0',
  node: '10.9.0',
  openssl: '1.1.0i',
  tz: '2018e',
  unicode: '11.0',
  uv: '1.22.0',
  v8: '6.8.275.24-node.14',
  zlib: '1.2.11' }
$ node -p process.platform
win32