maxlath / wikibase-cli

read and edit a Wikibase instance from the command line
MIT License
223 stars 24 forks source link

failure to install on cygwin #89

Closed VladimirAlexiev closed 4 years ago

VladimirAlexiev commented 4 years ago

I'm trying to install on windows and I have cygwin. I've tried this from cmd or bash:

npm install -g wikibase-cli

And in both cases I get these errors:

45 silly fetchPackageMetaData error for commander@git+https://github.com/maxlath/commander.js.git#master Command failed: git clone --depth=1 -q -b master https://github.com/maxlath/commander.js.git C:\Users\vladimir.alexiev.000\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-5c9e9ded --config core.longpaths=true
45 silly fetchPackageMetaData fatal: Invalid path '/cygdrive/c/Users/vladimir.alexiev.000/AppData/Roaming/npm-cache/_cacache/tmp/git-clone-5c9e9ded/C:\Users\vladimir.alexiev.000\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-5c9e9ded': No such file or directory

65 verbose stack Error: Command failed: git clone --depth=1 -q -b master https://github.com/maxlath/commander.js.git C:\Users\vladimir.alexiev.000\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-5c9e9ded --config core.longpaths=true
65 verbose stack fatal: Invalid path '/cygdrive/c/Users/vladimir.alexiev.000/AppData/Roaming/npm-cache/_cacache/tmp/git-clone-5c9e9ded/C:\Users\vladimir.alexiev.000\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-5c9e9ded': No such file or directory

72 error Command failed: git clone --depth=1 -q -b master https://github.com/maxlath/commander.js.git C:\Users\vladimir.alexiev.000\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-5c9e9ded --config core.longpaths=true
72 error fatal: Invalid path '/cygdrive/c/Users/vladimir.alexiev.000/AppData/Roaming/npm-cache/_cacache/tmp/git-clone-5c9e9ded/C:\Users\vladimir.alexiev.000\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-5c9e9ded': No such file or directory

(I can attach the complete log C:\Users\vladimir.alexiev.000\AppData\Roaming\npm-cache_logs\2019-10-04T07_00_10_884Z-debug.log if needed).

/cygdrive/c/ and C:\ mean basically the same thing but in cygwin'ish vs dos'ish. So I can't figure out what tries to double the target path.

I tried this command manually:

git clone --depth=1 -q -b master https://github.com/maxlath/commander.js.git C:\Users\vladimir.alexiev.000\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-5c9e9ded

It works in cygwin but in cmd it tries to prepend the cwd and fails:

fatal: Invalid path '/cygdrive/c/C:\Users\vladimir.alexiev.000\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-5c9e9ded': No such file or directory
VladimirAlexiev commented 4 years ago
maxlath commented 4 years ago

which version of npm are you using? some old versions of npm were struggling with git dependencies, and that was solved with nvm as it installed a more recent version of npm.

As for why the git dependency, I use a fix and a custom feature that are missing on commander

VladimirAlexiev commented 4 years ago

hi @maxlath thanks for looking into this!

I got the latest version:

npm --version                                                                                                                                     6.11.3

So using nvm won't help in this case?

VladimirAlexiev commented 4 years ago

I see that NPM tried to create this file, with an unprintable Unicode char and missing slashes: c:\my\CUsersvladimir.alexiev.000AppDataRoamingnpm-cache_cacachetmpgit-clone-5c9e9ded

maxlath commented 4 years ago

I replaced the git dependency by a scoped patched package and published it in v8.1.0: could you try to install it to see if the issue is resolved?

VladimirAlexiev commented 4 years ago

@maxlath Thanks a lot, works like a charm!!

$ npm install -g wikibase-cli                                                                                                                          C:\Users\vladimir.alexiev.000\AppData\Roaming\npm\wb -> C:\Users\vladimir.alexiev.000\AppData\Roaming\npm\node_modules\wikibase-cli\bin\wb             C:\Users\vladimir.alexiev.000\AppData\Roaming\npm\wd -> C:\Users\vladimir.alexiev.000\AppData\Roaming\npm\node_modules\wikibase-cli\bin\wd             + wikibase-cli@8.1.0                                                                                                                                   added 92 packages from 78 contributors in 15.983s

(Note: https://github.com/maxlath/wikibase-cli/releases is 2 years old; since you now release on npm, maybe you can somehow mark this page as obsolete? Maybe mention it in README.md)

maxlath commented 4 years ago

@VladimirAlexiev I updated the Github release page, and it should now (1eae62b) be automatically updated