Cannot find module 'resemblejs/compareImages'
yashrajb opened this issue · comments
Here is the error i am getting. it is running fine on locally but failed in Jenkins
Error: Cannot find module 'resemblejs/compareImages'
at Object.<anonymous> (/workspace/pageModels/maps.js:12:23)
at Object.require.extensions.(anonymous function) [as .js] (/workspace/node_modules/testcafe/src/compiler/test-file/api-based.js:92:25)
at Object.<anonymous> (/workspace/pageModels/pageFactory.js:15:1)
at Object.require.extensions.(anonymous function) [as .js] (/workspace/node_modules/testcafe/src/compiler/test-file/api-based.js:92:25)
at Object.<anonymous> (/workspace/tests/create-maps.testcafe.js:2:1)
at Function._execAsModule (/workspace/node_modules/testcafe/src/compiler/test-file/api-based.js:50:13)
at ESNextTestFileCompiler._runCompiledCode (/workspace/node_modules/testcafe/src/compiler/test-file/api-based.js:150:42)
at ESNextTestFileCompiler.execute (/workspace/node_modules/testcafe/src/compiler/test-file/api-based.js:174:21)
at ESNextTestFileCompiler.compile (/workspace/node_modules/testcafe/src/compiler/test-file/api-based.js:180:21)
at Compiler._getTests (/workspace/node_modules/testcafe/src/compiler/index.js:86:31)
Here is the code
const compareImages = require("resemblejs/compareImages");
var outputEdges = await compareImages(
fs.readFileSync(sourceImage.imgName1),
fs.readFileSync(targetImage.imgName1),
options)
var outputNodes = await compareImages(
fs.readFileSync(sourceImage.imgName2),
fs.readFileSync(targetImage.imgName2),
options)
I'm not sure, but looks like it's not resolving the dependency correctly, presumably because of a failed npm install in Jenkins