levelgraph / levelgraph-n3

LevelGraph plugin for storing N3/Turtle/RDF data
36 stars 8 forks source link

Installation failed in npm #25

Open dr-haoliu opened 3 years ago

dr-haoliu commented 3 years ago

$ npm install level levelgraph levelgraph-n3 --save Build failure. Could anyone help?

I am using npm -v
7.23.0 node -v
v16.9.0

Should I downgrade to npm 2.1.3 to make it work?

mcollina commented 3 years ago

no clue, I have not used this module in a long time. I think it would need significant work to make it viable again.

finwo commented 3 years ago

@hl2659 Do you have logs of when it failed to install?

finwo commented 3 years ago

After updating the dependencies, it seems the n3 library has some issues (see traceback)

n3.getStream should convert a single triple into n3:
     Uncaught TypeError: Cannot read property 'equals' of undefined
      at N3Writer._writeQuad (node_modules/n3/lib/N3Writer.js:107:18)
      at N3Writer.addQuad (node_modules/n3/lib/N3Writer.js:248:36)
      at N3StreamWriter._transform (node_modules/n3/lib/N3StreamWriter.js:35:14)
      at N3StreamWriter.Transform._read (node_modules/readable-stream/lib/_stream_transform.js:177:10)
      at N3StreamWriter.Transform._write (node_modules/readable-stream/lib/_stream_transform.js:164:83)
      at doWrite (node_modules/readable-stream/lib/_stream_writable.js:409:139)
      at writeOrBuffer (node_modules/readable-stream/lib/_stream_writable.js:398:5)
      at N3StreamWriter.Writable.write (node_modules/readable-stream/lib/_stream_writable.js:307:11)
      at ReadStream.ondata (node_modules/readable-stream/lib/_stream_readable.js:681:20)
      at ReadStream.emit (node:events:394:28)
      at addChunk (node_modules/readable-stream/lib/_stream_readable.js:298:12)
      at readableAddChunk (node_modules/readable-stream/lib/_stream_readable.js:280:11)
      at ReadStream.Readable.push (node_modules/readable-stream/lib/_stream_readable.js:241:10)
      at node_modules/level-mem/node_modules/level-iterator-stream/index.js:33:12
      at node_modules/level-mem/node_modules/abstract-leveldown/abstract-iterator.js:33:14
      at node_modules/level-mem/node_modules/encoding-down/index.js:140:5
      at node_modules/level-mem/node_modules/memdown/node_modules/abstract-leveldown/abstract-iterator.js:33:14
      at Immediate.callNext (node_modules/level-mem/node_modules/memdown/memdown.js:112:5)
      at processImmediate (node:internal/timers:464:21)

@mcollina Is there a clear definition of what functions are implemented beyond the tests which I could use to re-build this library?

dr-haoliu commented 3 years ago

@finwo Thanks a lot for getting on this. I attached the failure message from the console and the log file. Please let me know if anything else is needed. npm install levelgraph-n3 failed.txt 2021-09-10T15_12_23_082Z-debug.log

finwo commented 2 years ago

@hl2659 I recently had a similar issue with a different library, being caused by one of the dependencies not being up-to-date enough to compile with node 16.

Are you able to try with an older version of node (through nvm or another manager) to see if that'll work on your machine?

dr-haoliu commented 2 years ago

I also failed with the old version of node due to some incompatible issues, which I could not remember. I have to give up the use of this resources. Sorry guys.
I would appreciate and use it if someone could update this to more recent versions of Node if it is not too much trouble. Thanks.

finwo commented 2 years ago

No worries, it took a long time to get a response, so finding a different solution or workaround is to be expected.

finwo commented 2 years ago

@mcollina Would you be opposed to me rewriting this module from scratch, keeping the unit tests?

There seem to be issues with how the streams in combination with the n3 library work, so a fresh write with the same api would be the easiest way to fix this.

mcollina commented 2 years ago

Sure

mcollina commented 2 years ago

Go for it!