Hello, I’m unable to get the node.js API to work when running the “Node.js Example” in the documentation.
After installing aspose.diagram
npm i aspose.diagram
I get the following error message when running the node script.
node:internal/modules/cjs/loader:922
throw err;
^
Error: Cannot find module '../build/jvm_dll_path.json'
Require stack:
- C:\localDev\VisioFun\node_modules\java\lib\nodeJavaBridge.js
- C:\localDev\VisioFun\node_modules\java\index.js
- C:\localDev\VisioFun\node_modules\aspose.diagram\lib\aspose.diagram.js
- C:\localDev\VisioFun\node_modules\aspose.diagram\index.js
- C:\localDev\VisioFun\index.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:15)
at Function.Module._load (node:internal/modules/cjs/loader:763:27)
at Module.require (node:internal/modules/cjs/loader:991:19)
at require (node:internal/modules/cjs/helpers:92:18)
at Object.<anonymous> (C:\localDev\VisioFun\node_modules\java\lib\nodeJavaBridge.js:3:21)
at Module._compile (node:internal/modules/cjs/loader:1102:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1131:10)
at Module.load (node:internal/modules/cjs/loader:967:32)
at Function.Module._load (node:internal/modules/cjs/loader:807:14)
at Module.require (node:internal/modules/cjs/loader:991:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\localDev\\VisioFun\\node_modules\\java\\lib\\nodeJavaBridge.js',
'C:\\localDev\\VisioFun\\node_modules\\java\\index.js',
'C:\\localDev\\VisioFun\\node_modules\\aspose.diagram\\lib\\aspose.diagram.js',
'C:\\localDev\\VisioFun\\node_modules\\aspose.diagram\\index.js',
'C:\\localDev\\VisioFun\\index.js'
]
}
The .json file that is being “required” in the code below does not exist, and I’m unsure as to why that is.
node_modules > java > lib > nodeJavaBridge.js:3:21
process.env.PATH += require('../build/jvm_dll_path.json');
I’m running node v15.3.0, and npm 7.0.15. I also tried and failed with node v14.13.1. I tried multiple installs, and I tried clearing the npm cache. Any idea what might be going on?