Hi Guys,
I have created based on a tutorial the following nodejs script and imported this as a zip into an nodejs action.
But if I start the script (FaaS onPrem) am getting the following error Message (Error: Cannot find module '/function/main'):
script name is main.js and the entry point handler which have been configured properly in the ABX action.
exit status 1
internal/modules/cjs/loader.js:1088
throw err;
^
Error: Cannot find module '/function/main'
Require stack:
- /function/abx_wrapper.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1085:15)
at Function.Module._load (internal/modules/cjs/loader.js:928:27)
at Module.require (internal/modules/cjs/loader.js:1145:19)
at require (internal/modules/cjs/helpers.js:75:18)
at Object.<anonymous> (/function/abx_wrapper.js:415:20)
at Module._compile (internal/modules/cjs/loader.js:1256:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1277:10)
at Module.load (internal/modules/cjs/loader.js:1105:32)
at Function.Module._load (internal/modules/cjs/loader.js:967:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [ '/function/abx_wrapper.js' ]
}
Hi,
I don’t have an Internet connection on the appliance, so can not fetch the request dependencies. For this reason have to import it as a zip file.
Cheers Ertan
Hi @DrBrainX ,
If you create the action from scratch ... works? I think this is a zip formatting issue.... If no sensitive information is there, can you attach the zip file?
Regards,
Leandro.
Hi,
As far as I can see quickly, inside the zip file you have a folder and then the content. You should have all files and folders in the root directory for the zip file, not inside a folder.
This is from our documentation
"Both your script and dependency elements must be stored at the root level of the ZIP package. When creating the ZIP package in a Linux environment, you might encounter a problem where the package content is not stored at the root level. If you encounter this problem, create the package by running the zip -r command in your command-line shell."
Can you modify the zip structure and try again?
Regards,
Leandro.
Hi,
now it's running with the following error message:
Strange.... if you create the script directly in vRA - just to test -, do you have any error in the execution?
Hi,
I don’t have an Internet connection on the appliance, so can not fetch the request dependencies. For this reason have to import it as a zip file.
Cheers Ertan
Hi,
I have added an upstream proxy to my vRA appliance and started the nodejs script direcetly as an Action but I do still get the following error message:
Cheers Ertan