SamuraiWTF / katana

SamuraiWTF package management tool and interface.
20 stars 8 forks source link

JuiceShop is failing to start, with a NODE_MODULE_VERSION error. #23

Closed JGillam closed 4 years ago

JGillam commented 4 years ago

JuiceShop won't start up and the following stack trace is in the output:

(node:98013) UnhandledPromiseRejectionWarning: Error: The module '/opt/targets/juice-shop/juice-shop_11.1.3/node_modules/libxmljs2/build/Release/xmljs.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 64. This version of Node.js requires
NODE_MODULE_VERSION 72. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:1187:18)
    at Module.load (internal/modules/cjs/loader.js:985:32)
    at Function.Module._load (internal/modules/cjs/loader.js:878:14)
    at Module.require (internal/modules/cjs/loader.js:1025:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at bindings (/opt/targets/juice-shop/juice-shop_11.1.3/node_modules/bindings/bindings.js:112:48)
    at Object.<anonymous> (/opt/targets/juice-shop/juice-shop_11.1.3/node_modules/libxmljs2/lib/bindings.js:1:37)
    at Module._compile (internal/modules/cjs/loader.js:1137:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
    at Module.load (internal/modules/cjs/loader.js:985:32)
    at Function.Module._load (internal/modules/cjs/loader.js:878:14)
    at Module.require (internal/modules/cjs/loader.js:1025:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/opt/targets/juice-shop/juice-shop_11.1.3/node_modules/libxmljs2/index.js:4:18)
    at Module._compile (internal/modules/cjs/loader.js:1137:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
(node:98013) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:98013) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I attempted to recompile with it as-is but this didn't work, so best initial guess is there is a mismatch between the version of node in the base box and the version required by JuiceShop.

mgillam commented 4 years ago

I haven't used NVM much in the past, but used it recently and liked how it worked. If we find that Node versions are a moving target, that will probably make it easiest.

Otherwise, I'd maybe just pull the matching version from: https://github.com/nodesource/distributions

mgillam commented 4 years ago

NVM link - https://github.com/nvm-sh/nvm