maxlath / wikibase-cli

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

npm install wikidata-cli ./scripts/postinstall #72

Closed higimo closed 4 years ago

higimo commented 5 years ago

λ npm install wikidata-cli

wikidata-cli@7.2.1 postinstall C:\home\wd\node_modules\wikidata-cli
./scripts/postinstall

'.' is not recognized as an internal or external command,
operable program or batch file.
npm WARN enoent ENOENT: no such file or directory, open 'C:\home\wd\package.json'
npm WARN wd No description
npm WARN wd No repository field.
npm WARN wd No README data
npm WARN wd No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! wikidata-cli@7.2.1 postinstall: ./scripts/postinstall
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the wikidata-cli@7.2.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

maxlath commented 5 years ago

I'm not familiar with running scripts on Windows, do you have a clue on what might have gone wrong?

higimo commented 5 years ago

@maxlath why not rewrite postinstall to npx ./scripts/check_node_version?

maxlath commented 5 years ago

I would like to understand why it's not working as such in the first place ^^ is it that bash scripts are executed differently on Windows?

higimo commented 5 years ago

@maxlath in Windows sh is not recognized as an internal or external command.

maxlath commented 5 years ago

@higimo and bash?

higimo commented 5 years ago

@maxlath and bash=) But npx is working!

Jheald commented 5 years ago

Not surprisingly I got this as well, trying to install on Windows.

Per @higimo I tried changing the postinstall line to "postinstall": "npx ./scripts/check_node_version" but that also failed with "'.' is not recognized as an internal or external command" -- possibly because Windows can't make sense of the forward slashes in the filename, rather than the backslashes it expects.

So instead I've just removed the postinstall line entirely from the package.json and now the install seems to have completed fine. I hope it didn't do anything too critical, but it looked as if it was just a check.

maxlath commented 5 years ago

yes it's just a check of the current node version, but now I'm very confused by what works or not on Windows o_O

maxlath commented 5 years ago

should have been fixed in > v8 thank to cb06a7b, can you confirm