maxlath / wikibase-cli

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

installation with npm #86

Closed HakanIST closed 4 years ago

HakanIST commented 4 years ago

Hello,

I'm trying to install wikibase-cli on a centos 7 with Node 10.16.3 installed. I've used npm install however it wb and wd commands not working.

[root@saturn ~]# npm install -g wikibase-cli
+ wikibase-cli@0.0.0
added 1 package in 2.423s
[root@saturn ~]# ls -al  /usr/local/lib/node_modules/wikibase-cli/
total 16
drwxr-xr-x  2 root root 4096 Oct  1 15:45 .
drwxr-xr-x 13 root root 4096 Oct  1 15:45 ..
-rw-r--r--  1 root root   65 Oct 26  1985 index.js
-rw-r--r--  1 root root 1009 Oct  1 15:45 package.json

Alternatively I've cloned the repo and run npm install on the copy. Now read operations are working with ./wb however write operation gives following error:

[hozdemir@chicago bin]$ ./wb ac Q181395 P7348 359
internal/modules/cjs/loader.js:775
    throw err;
    ^

Error: Cannot find module '../metadata/create-claim'
Require stack:
- /home/hozdemir/wiki/matches/lib/program.js
- /home/hozdemir/wiki/matches/lib/edit/edit_command.js
- /home/hozdemir/wiki/matches/bin/wb-add-claim
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:772:15)
    at Function.Module._load (internal/modules/cjs/loader.js:677:27)
    at Module.require (internal/modules/cjs/loader.js:830:19)
    at require (internal/modules/cjs/helpers.js:68:18)
    at Command.program.process (/home/hozdemir/wiki/matches/lib/program.js:12:22)
    at module.exports (/home/hozdemir/wiki/matches/lib/edit/edit_command.js:9:11)
    at Object.<anonymous> (/home/hozdemir/wiki/matches/bin/wb-add-claim:2:36)
    at Module._compile (internal/modules/cjs/loader.js:936:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:947:10)
    at Module.load (internal/modules/cjs/loader.js:790:32)
    at Function.Module._load (internal/modules/cjs/loader.js:703:12)
    at Function.Module.runMain (internal/modules/cjs/loader.js:999:10)
    at internal/main/run_main_module.js:17:11 {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/hozdemir/wiki/matches/lib/program.js',
    '/home/hozdemir/wiki/matches/lib/edit/edit_command.js',
    '/home/hozdemir/wiki/matches/bin/wb-add-claim'
  ]
}

Thanks in advance,

maxlath commented 4 years ago

sorry for that, the master branch on github was showing the documentation for the >v8 while it had not been published on npm: it is now the case.

as for the ../metadata/create-claim, it should have been fixed by 9809123

HakanIST commented 4 years ago

Great! Thanks again for another fast fix, also for the tool it's super handy.