standalone nodejs proxy wouldn't find the node module

Not applicable

I've a simple node.js server that leverages some external modules. Works locally on node v6.12.0 npm 3.10.10.

Using below command to deploy to apigee

apigeetool deploynodeapp -U -n hola-proxy -d . -m server.js -o <<org name>> -e test -b /hola-proxy -u <<username>> -p <<pass>>

Post deployment, I see all the node_modules_xyz.zip files along with .js scripts and package.json.

However, when I hit the proxy, it returns 500. Tracing the proxy shows that it wouldn't find the node module which is sitting right there in the .zip file..

This forum thread might be relevant but its closed as not reproducible. Any solutions?

Solved Solved
0 4 267
1 ACCEPTED SOLUTION

When testing your JavaScript locally, you need to test with v0.10.x. I'm not 100% sure that's the case but it would help.

View solution in original post

4 REPLIES 4

@SAHAS SUBRAMANIAN have your tried doing the same but using the maven plugin ? Also, if you are deploying to the cloud check to see that you don't have modules that will not be allowed to run. https://community.apigee.com/questions/45790/comprehensive-list-of-unaccepted-node-modules.html

When testing your JavaScript locally, you need to test with v0.10.x. I'm not 100% sure that's the case but it would help.

@Jeremy Whitlock, Thank you!! this helps me to reproduce the problem in local..appreciate your help.

Happy to help.