Cannot find module 'node-html-parser'
Hi, I am running the latest version of Ubuntu, when running your code as specified in your docs I am getting the below error.
`sudo node confluence2wikijs.js import/ Export/ internal/modules/cjs/loader.js:818 throw err; ^
Error: Cannot find module 'node-html-parser' Require stack:
- /home/ConfluenceToWikiJS/confluence2wikijs.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
at Function.Module._load (internal/modules/cjs/loader.js:667:27)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.
(/home/ConfluenceToWikiJS/confluence2wikijs.js:4:18) at Module._compile (internal/modules/cjs/loader.js:999:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) at Module.load (internal/modules/cjs/loader.js:863:32) at Function.Module._load (internal/modules/cjs/loader.js:708:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12) { code: 'MODULE_NOT_FOUND', requireStack: [ '/home/ConfluenceToWikiJS/confluence2wikijs.js' ] } aasim@Wiki:/home/ConfluenceToWikiJS$ sudo apt install node-htmlparser Reading package lists... Done Building dependency tree... Done Reading state information... Done E: Unable to locate package node-htmlparser aasim@Wiki:/home/ConfluenceToWikiJS$ sudo apt install node-html-parser Reading package lists... Done Building dependency tree... Done Reading state information... Done E: Unable to locate package node-html-parser `
there is no such module called node-html-parser, I tried installing node-htmlparser2 and changing the name node-html-parser to node-htmlparser2 in .js file but that didn't help either.
Any help would be appreciated.
Try installing it with npm install --save node-html-parser
More info here: https://www.npmjs.com/package/node-html-parser
I got it to work by opening the directory of the script in Visual Studio code and then running the command npm install --save node-html-parser then running the script within VS Code.