Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

npm install with local packages and symlinks - ENOENT ... #21197

Open
1 of 14 tasks
MrSpider opened this issue Jul 11, 2018 · 3 comments
Open
1 of 14 tasks

npm install with local packages and symlinks - ENOENT ... #21197

MrSpider opened this issue Jul 11, 2018 · 3 comments

Comments

@MrSpider
Copy link

I'm opening this issue because:

  • npm is crashing.
  • npm is producing an incorrect install.
  • npm is doing something I don't understand.
  • npm is producing incorrect or undesirable behavior.
  • Other (see below for feature requests):

What's going wrong?

A lot of ENOENTS for files not being found while doing npm install.

See full output and npm debug log:
https://gist.github.com/MrSpider/883b1ef97bd099e07ae5d48954ddb117

My current workaround is the following

# This installs every package (like npm install) while removing our local packages
npm uninstall --save @shopiq/smp @shopiq/process-scheduler
# Now I have to reinstall our local packages
npm install --save ./shared/typescript/smp ./shared/typescript/process-scheduler

Deleting the package-lock.json in the server directory allows npm install to finish without errors, but is obviously not practical for daily use.

How can the CLI team reproduce the problem?

https://github.com/MrSpider/npm-bugsample

git clone git@github.com:MrSpider/npm-bugsample.git
cd npm-bugsample/server
npm install

Note: For reproducing this error on Windows you have to enable symlinks in git for windows or create the symlink manually after cloning with either mklink or ln in WSL.

supporting information:

  • npm -v prints: 6.1.0
  • node -v prints: 8.9.4
  • npm config get registry prints: https://registry.npmjs.org/
  • Windows, OS X/macOS, or Linux?: Windows (but also tested on WSL)
  • Network issues:
    • Geographic location where npm was run:
    • I use a proxy to connect to the npm registry.
    • I use a proxy to connect to the web.
    • I use a proxy when downloading Git repos.
    • I access the npm registry via a VPN
    • I don't use a proxy, but have limited or unreliable internet access.
  • Container:
    • I develop using Vagrant on Windows.
    • I develop using Vagrant on OS X or Linux.
    • I develop / deploy using Docker.
    • I deploy to a PaaS (Triton, Heroku).
@DanielRuf
Copy link

Can you try downgrading to npm 5?

@MrSpider
Copy link
Author

C:\dev\npm-bugsample\server [master]
λ  npm install -g npm@5.10.0
C:\Users\MrSpider\AppData\Roaming\npm\npx -> C:\Users\MrSpider\AppData\Roaming\npm\node_modules\npm\bin\npx-cli.js
C:\Users\MrSpider\AppData\Roaming\npm\npm -> C:\Users\MrSpider\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js
+ npm@5.10.0
added 39 packages from 17 contributors, removed 158 packages and updated 28 packages in 103.102
C:\dev\npm-bugsample\server [master +1 ~1 -0 !]
λ  npm install
npm WARN tar ENOENT: no such file or directory, open 'C:\dev\npm-bugsample\server\node_modules\.staging\gulp-flatten-6f053e3d\test\flatten-path.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\dev\npm-bugsample\server\node_modules\.staging\karma-c2f66a63\common\stringify.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\dev\npm-bugsample\server\node_modules\.staging\fullcalendar-scheduler-cd4e6fb4\dist\scheduler.css'
npm WARN tar ENOENT: no such file or directory, open 'C:\dev\npm-bugsample\server\node_modules\.staging\gulp-flatten-6f053e3d\test\main.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\dev\npm-bugsample\server\node_modules\.staging\karma-c2f66a63\common\util.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\dev\npm-bugsample\server\node_modules\.staging\fullcalendar-scheduler-cd4e6fb4\dist\scheduler.d.ts'
npm WARN tar ENOENT: no such file or directory, open 'C:\dev\npm-bugsample\server\node_modules\.staging\ui-select-5e50568a\docs\examples\demo-focus.html'
npm WARN tar ENOENT: no such file or directory, open 'C:\dev\npm-bugsample\server\node_modules\.staging\ui-select-5e50568a\docs\examples\demo-append-to-body.html'

[...]

npm ERR! path C:\dev\npm-bugsample\server\node_modules\.staging\@shopiq\smp-0cd77b89\node_modules\@types\events
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\dev\npm-bugsample\server\node_modules\.staging\@shopiq\smp-0cd77b89\node_modules\@types\events' -> 'C:\dev\npm-bugsample\server\node_modules\.staging\@types\events-f66ccbd4'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm WARN tar ENOENT: no such file or directory, open 'C:\dev\npm-bugsample\server\node_modules\.staging\webpack-03692eba\lib\web\WebEnvironmentPlugin.js'

Full output and debug log

@DanielRuf
Copy link

Please try deleting the node_modules directory and try it again.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants