The error makes perfect sense as there is no folder for \node_modules\serverless\bin\serverless within the project. but I am now stuck. My question is
"In the stack overflow question above have the developers pulled serverless into the project so that \node_modules\serverless\bin\serverless now contains a copy of what is stored in AppData\Roaming\npm\node_modules\serverless\bin (which is where the console runs serverless from) "?
or are they doing something else? could someone point me in the right direction?
No I hadn’t spotted that command so I tried it but it still wouldn’t run. But you pointed me in the right direction, I did some searching on npm install which lead me back to some of the serverless hello world examples
I saw that I had initially installed serverless globally by running
npm install serverless -g
so I took a punt and tried
npm install serverless
in the project directory to see what would happen. This appeared to do the trick as I now have the node_modules sub directory installed below the project, I changed the launch.json program value back to the value in the accepted answer on stack overflow tried again and it debugged straight into it.
So I now have the hello world example up and running which is great, thanks for the suggestion !
Has anyone done the same for golang lambda functions ?. Using the same approach, I can launch the golang function however as the type is “node”, the function is not being stopped at the breakpoint. Changing this to “go” (and using delve) doesn’t work as the program is no longer a “go” program.