connect-deps
connect-deps copied to clipboard
Added npm version check
When using an npm version 6.x.x
, npm pack
wrongly parses git output, producing the following error:
Error: ENOENT: no such file or directory, rename '/redacted/.connect-deps-cache/Your branch is up to date with 'origin/master'.
typeorm-test-transactions-1.14.2.tgz' -> '/redacted/.connect-deps-cache/typeorm-test-transactions-1.14.2-1615418598555.tgz'
at Object.renameSync (fs.js:772:3)
at Object.pack (/home/redacted/connect-deps/cli.js:104:16)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async packInstall (/home/redacted/connect-deps/cli.js:321:13)
at async connect (/home/redacted/connect-deps/cli.js:215:5)
I could have added npm ^7.x.x
to the dependencies, but this is unnecessary for people using yarn (and it adds extra bulk to the package). Instead, I implemented a function that checks if the global npm version is compatible with v7 and throws an error if it isn't.
can you explain this better, i have used connect-deps
with npm 6. maybe a way for me to replicate this issue ?
It might just be that I had a very specific version of npm that caused this bug. I'm not sure if I can find it now since I updated to get rid of it. Basically what happened was, npm pack
ran some git commands in the background and parsed the second line, which would normally give the current directory. For some reason git would output three lines, where the second one was Your branch is up to date with origin/master
. If I could somehow find out which npm version I had, we could try to reproduce it. I just assumed the package might be broken for npm < v7