I'm new to Apigee, so I hope this isn't a silly question... I'd like to upload a pre-existing Node project into Apigee using the 'apigeetool'; my understanding is that before uploading I must run 'npm install' in order to build all dependencies. Using the 'deploynodeapp' function in a similar manor to this:
apigeetool deploynodeapp -n <some name> -d <path to root of node project> -o <organisation> -e qa -b <path> -u <email> -m <root js file>This gives the following error:
"message" : "com.apigee.datastore.DataAccessException{ code = datastore.ErrorWhileAccessingDataStore, message = Error while accessing datastore;Please retry later, associated contexts = []}"
Now I believe that this is due to exceeding some sort of package size issue, 15mb?, which I have seen loosely coupled with the error I'm seeing. Looking at the project size I can see that node_modules is far greater than 15mb. Removing the node_modules directory, as a test, and then uploading the node project is successful (and a total size of <1mb). So my question is, can this limit be changed? and if so how does one go about doing this?
Thanks
@alex.tylor , Great Question, Welcome to Apigee Community. I have asked experts to answer same. Stay tuned.
@alex.tylor , You can also try to push the node application without installing dependencies & later install same using Apigee Edge API. You can find more about API here.
PS: I am not sure whether it works but worth to give a try.
Answer by gnanasekaran · Oct 06, 2015 at 01:51 PM
Hi @alex.tylor,
what you have done is right,
> remove the node_modules and upload your proxy first
then,
> you can use this API to install the node modules dependencies
http://apigee.com/docs/management/apis/post/organi...
Thanks,
Answer by alex.tylor · Oct 06, 2015 at 04:01 PM
Thanks you @Mukundha Madhavan and @Anil Sagar, going through that has proven useful, I think that I got slightly confused with uploading a node instance as a proxy and the node_module directory up as a zip, over uploading a standalone node project using apigeetool... So using the curl command and passing in 'install' as the desired npm action using:
curl -X POST --header "Content-Type: application/x-www-form-urlencoded" --header "Authorization: Basic <basic auth header value>==" -d "command=install" "https://api.enterprise.apigee.com/v1/organizations/<org>/apis/<some name>/revisions/9/npm?verbose=true"
This doesn't seem to work; using the curl example above it gives no feedback (even with verbose set as true); and when I make the same call via the webpage link provided I simply get:
An internal error has occurred. Please retry your request.
Which seems to be shown on both the request and response tab.
I realised that a package that is globally installed was not in the pacakge.json so having updated this, re-uploaded the node project and then tried the 'npm install' via both the curl and provided webpage link. Unfortunately this fails and returns no feedback; is there a way to see why it is failing? Thanks
Answer by alex.tylor · Oct 13, 2015 at 09:27 AM
With the '-U' switch the apigeetool is able to deploy the application without removing the 'node_modules' directory prior, however I'm not seeing the 'node_manager' directory available within the Apigee proxy editor.