Description
Note that this same issue was reported back in 2017 on the now-archived repo: npm/npm#15783
Current Behavior:
I am using npm link
to try to test changes I am making to an upstream dependency within my own project. In the dependency directory I run npm link
. Then in my own project I run npm link ffmpeg-stream
.
NPM gives the following error message when running the second link command:
npm ERR! code 1
npm ERR! path D:\git\node-ffmpeg-stream
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c "tsc"
npm ERR! Version 3.9.7
npm ERR! Syntax: tsc [options] [file...]
Afterwards, the directory of the upstream dependency is empty. Even the .git
directory is deleted, so tough luck if you haven't pushed recently.
Expected Behavior:
NPM link should link the package without issue. If an error is encountered, NPM should not delete the entire folder contents.
Steps To Reproduce:
-
Clone
https://github.com/JoshuaWalsh/node-ffmpeg-stream/
-
Clone
https://github.com/JoshuaWalsh/subtitle-indexer
-
In
node-ffmpeg-stream
, runnpm ci --include=prod
-
In
node-ffmpeg-stream
, runnpm link
-
In
subtitle-indexer
, runnpm link ffmpeg-stream
-
Observe that the
node-ffmpeg-stream
directory is now empty. (A small number of files may remain if they were in use at the time and couldn't be deleted)
Environment:
- OS: Windows 10 Pro 10.0.19042
- Node: 15.0.1
- npm: 7.0.3
I am using nvm-windows
to manage NodeJS, but currently only have one version installed.