Closed jgoodie closed 11 months ago
@jgoodie I haven't tested with node 21, but let me know the experience. I believe it is fixed now. The problem was that I had an old stale module running around and was not using the new module which has a new maintainer.
The fix was:
package.json
file this means "@json2csv/plainjs": "^7.0.4"
.src/cli/output.js
ensure that the new module is imported import {Parser} from '@json2csv/plainjs'
and the new way to call the parser
method was performed. This means that we'd construct a new Parser object with const csvParser = new Parser()
and then call csvParser.parse(objs)
.To check the fix please run: sudo npm i -g mediumroast_js
@miha42-github it looks good. I'll close this out.
This is closed, the problem was the new module for json2csv was included in the package just not imported and used. This was fixed.
Unable to run mrcli setup:
Error messages states: "Cannot find package 'json2csv'". Even after installing json2csv, the error persists.
Discovered on Ubuntu 22.04.3 LTS.
john@medici:~$ npm --version 10.2.4
john@medici:~$ node -v v21.4.0
john@medici:~$ mrcli setup node:internal/modules/esm/resolve:853 throw new ERR_MODULE_NOT_FOUND(packageName, fileURLToPath(base), null); ^
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'json2csv' imported from /usr/local/lib/node_modules/mediumroast_js/src/cli/output.js at packageResolve (node:internal/modules/esm/resolve:853:9) at moduleResolve (node:internal/modules/esm/resolve:910:20) at defaultResolve (node:internal/modules/esm/resolve:1130:11) at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:396:12) at ModuleLoader.resolve (node:internal/modules/esm/loader:365:25) at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:240:38) at ModuleWrap. (node:internal/modules/esm/module_job:85:39)
at link (node:internal/modules/esm/module_job:84:36) {
code: 'ERR_MODULE_NOT_FOUND'
}
Node.js v21.4.0