0

wscat test

In my Python lambda I want to use wscat which requires node:

$ /opt/wscat-layer/bin/wscat

/usr/bin/env: node: No such file or directory

Question:

How do I add nodejs runtime to my Python lambda so i can execute wscat?

Alex B
  • 123
  • 5

1 Answers1

0

It looks like you need to place node in /opt/bin in order for it to be found by wscat. So, your layer structure should look like this:

Later_1->
   /bin
       /node

Later_2->
   /wscat-layer       
       /package.json
       /bin
           /wscat

"As is" wscat will fail because it could not find dependencies like ws, read, commander , etc.

Layer_3->
   /lib
       /node_modules
           /commander
           /https-proxy-agent
           /...

Now it works: python3 pyNode.py export NODE_PATH=/opt/lib/node_modules\;/opt/wscat-layer/bin/wscat --version

4.0.1
Alex B
  • 123
  • 5