davidag / tiddlywiki-migrator

Export tiddlers from a single-file html TiddlyWiki, "classic" or "modern", to Markdown.
MIT License
18 stars 5 forks source link

Node_modules directory needs to be manually moved into the repo's root directory in order for the scripts to run #2

Open happarakka opened 1 year ago

happarakka commented 1 year ago

Thank you for creating this TW migrator. I am very new to coding and node.js so it is quite likely that I ran into the following error because I set things up wrong. This is the error I got when I ran make:

Dependencies OK
Installing TiddlyWiki...
/home/USERNAME/.nvm/versions/node/v18.16.0/bin/npm install tiddlywiki

up to date, audited 2 packages in 392ms

found 0 vulnerabilities
Setting up temporary wiki...
/home/USERNAME/.nvm/versions/node/v18.16.0/bin/node node_modules/tiddlywiki/tiddlywiki.js tmp_wiki --init empty
node:internal/modules/cjs/loader:1078
  throw err;
  ^

Error: Cannot find module '/home/USERNAME/repos/tiddlywiki-migrator/node_modules/tiddlywiki/tiddlywiki.js'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)
    at Module._load (node:internal/modules/cjs/loader:920:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:23:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Node.js v18.16.0
make: *** [Makefile:71: tmp_wiki/tiddlywiki.info] Error 1

I solved this by copying the node_modules directory from the user root directory into the root directory of the repo. Both make and make convert worked after this.

Is this a mistake on my part or is it a genuine issue?

davidag commented 1 year ago

You're right @happarakka, I assumed that the tiddlywiki module is installed in the project root. The solution could be to add a package.json to this repo specifying the dependency. Then in make deps, run npm install.