I'm getting this error when I deploy my Lambda function:
module initialization error: Error
at Error (native)
at Object.Module._extensions..node (module.js:597:18)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at bindings (/var/task/node_modules/bindings/bindings.js:84:48)
at Object. (/var/task/node_modules/sharp/lib/constructor.js:10:34)
at Module._compile (module.js:570:32)
The serverless.yml and package.json:
https://github.com/A-Atrash/forfilesharingtohandleerror.
It's with Node. It used to work before I added a new package ImageMagick and started using it as an image validation. Any idea?
I believe you're creating your Lambda package from non-Linux environment (e.g. Windows or MacOS).
ImageMagick uses native modules so you when you do your npm install, it compiles it for your current environment. If you're in Windows or MacOS, this compiled package will not work Lambda (which uses Linux).
For it to work, your Lambda package has to be created in a Linux environment and then uploaded from there.
In my case it was source-map-support package that discarded the actual error message and stack trace.
Once I commented out the source-map-support package import line then the error started showing the actual error message and stack trace.
Related
my open-source project depends on a lemmatization module —
https://github.com/grachev/node-lemmer
— which needs to be compiled before it can run.
After updating to a newer version of node.js I can't run this module, because it needs to be re-compiled. Usually this was done when I simply did npm install node-lemmer however it is now not available in npm and I don't know how to compile it under that new node version and why I have to do it at all...
I tried running npm rebuild but it does not recompile – too many errors. The issues folder of that project on GitHub has the issue up already but there's no fix for it...
What could I do about it? Why do I need to recompile this module when I install a new version of node? Is there a workaround? Could I "trick" node or that module so it doesn't need to recompile? Or maybe it's possible to compile it manually?
...
Some mode details:
I used to run my project on node 0.8.3 vesion and then switched to the new 8.8.0 version. Now when I try to run my project under the new node version it doesn't start giving the following error:
module.js:641
return process.dlopen(module, path._makeLong(filename));
^
Error: Module did not self-register.
at Object.Module._extensions..node (module.js:641:18)
at Module.load (module.js:531:32)
at tryModuleLoad (module.js:494:12)
at Function.Module._load (module.js:486:3)
at Module.require (module.js:556:17)
at require (internal/module.js:11:18)
at Object.<anonymous>
(/path-to-my-project/node_modules/node-lemmer/lib/node-lemmer.js:1:82)
at Module._compile (module.js:612:30)
at Object.Module._extensions..js (module.js:623:10)
at Module.load (module.js:531:32)
which is an error I've seen before because my module could not be compiled.
my project is https://github.com/noduslabs/infranodus in case it helps to see the source code.
I'm using nodeclipse plugin in eclipse to start working with nodejs and expressjs ,but when i create expressjs project and try run app.js file i get this error
/home/ali/node_modules/express/lib/express.js:99
throw new Error('Most middleware (like ' + name + ') is no longer bundled with Express and must be installed separately. Please see https://github.com/senchalabs/connect#middleware.');
^
Error: Most middleware (like favicon) is no longer bundled with Express and must be installed separately. Please see https://github.com/senchalabs/connect#middleware.
at Function.Object.defineProperty.get (/home/ali/node_modules/express/lib/express.js:99:13)
at Object.<anonymous> (/home/ali/node-WS/express01/app.js:18:16)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Module.runMain (module.js:575:10)
at run (bootstrap_node.js:352:7)
at startup (bootstrap_node.js:144:9)
How can i fix this problem?
This means You have to install module separately. Maybe you're using latest version of expressJS.
installing modules separately will solve your problem!
I recently installed node-webgl in node.js server. Along with that it's dependencies node-glfw is installed automatically. I have also installed node-gyp.
However, when I try to run a program of either node-webgl or node-glfw I am facing error. Below is the error message:
C:\Users\z003npra>cd C:\Users\z003npra\Desktop\node\node_modules\node-webgl\examples
C:\Users\z003npra\Desktop\node\node_modules\node-webgl\examples>node wavefront.js
C:\Users\z003npra\Desktop\node\node_modules\bindings\bindings.js:83
throw e
^
Error: The specified module could not be found.
\\?\C:\Users\z003npra\Desktop\node\node_modules\node-webgl\build\Release\webgl.node
at Error (native)
at Object.Module._extensions..node (module.js:434:18)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at bindings(C:\Users\z003npra\Desktop\node\node_modules\bindings\bindings.js:76:44)
at Object.<anonymous> (C:\Users\z003npra\Desktop\node\node_modules\node-webg
l\lib\webgl.js:1:108)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
C:\Users\z003npra\Desktop\node\node_modules\node-webgl\examples>
This error is similar issue faced by a person quoted in the link: https://github.com/mikeseven/node-webgl/issues/47
I tried some possible solutions mentioned here, but issue is not getting solved.
It's working for the node.js version v4.5.0. But not working for node.js v4.4.6.
I'm having this problem when I try to run my node.js app. I have tried to remove my node_modules folder and then npm install but that doesn't work. Any idea?
Thanks!
This is the error :
node_modules/bindings/bindings.js:83
throw e
^
Error: Module did not self-register.
at Error (native)
at Object.Module._extensions..node (module.js:440:18)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Module.require (module.js:367:17)
at require (internal/module.js:16:19)
at bindings (/.../.../react-rpi/node_modules/bindings/bindings.js:76:44)
at Object.<anonymous> (/.../.../react-rpi/node_modules/epoll/epoll.js:1:99)
It is possible that you are trying to run a native module that did not compile for your architecture / peripherals.
Please comment those packages out (raspberry-gpio, libusb and others) and try to work it out from there.
I had problem installing CLD package into one of my machine, so I tried to install it into another machine and the installation works perfectly.
In the good machine, I installed the CLD package and wrote a simple app.js around it.
var cld = require('cld');
console.log('cld loaded');
When running this in the good machine, I receive console output "cld loaded" as expected. I copied the exact same code including the node_modules folder into the other machine and run it, I receive errors in the console output:
E:\Test>node app.js
module.js:423
return process.dlopen(module, path._makeLong(filename));
^
Error: The specified procedure could not be found.
\\?\E:\Test\node_modules\cld\build\Release\cld.node
at Error (native)
at Object.Module._extensions..node (module.js:423:18)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (E:\Test\node_modules\cld\index.js:2:12)
at Module._compile (module.js:398:26)
at Object.Module._extensions..js (module.js:405:10)
at Module.load (module.js:344:32)
I can confirm the file "E:\Test\node_modules\cld\build\Release\cld.node" is existing. I'm not sure what's the missing procedure here. I suspect there could be some external dependency required for the package.
Could anyone advise what could be the external dependency missing in the first installation?
Figured out it's a node.js version issue. I downgrade my nose.js to 0.10.28 and it works fine. I suppose it's some bug to be fixed by CLD.