Error on management api to get npm dependencies for an API proxy

I'm running an Apigee on premise instance (version 4.17.01). For the proxies using Node, have created package.json file for the depencies and tried running the below command to install those dependencies via the management API. But I am getting an error.

I have tried in cloud trial version as well. Same issue. Pls help?

Management API call:

curl -X GET --header "Authorization: Basic {base64 encoded string}" "https://[apigee_host]/v1/organizations/[org]/apis/[proxy_name]/revisions/1/npm"

Error Message:

HTTP/1.1 500 Server Error

Connection: keep-alive

Content-Length: 200

Content-Type: text/plain

Date: Mon, 30 Apr 2018 15:17:12 GMT

Server: Apigee LB

{ "problems": [ "missing: oracledb@, required by @" ], "dependencies": { "oracledb": { "required": "", "missing": true } } } npm ERR! missing: oracledb@, required by @

0 5 196
5 REPLIES 5

Unless its a miss in copy paste, to install dependencies you need to include the install command in the request body of the curl.

-d 'command=install'

https://apidocs.apigee.com/management/apis/post/organizations/%7Borg_name%7D/apis/%7Bapi_name%7D/rev...

If you do not specify anything, the default command executed is "ls"

@rmishra, Thank you for your prompt response. Both ls & install commands are working using POST operation ("Manage Node Packaged Modules"). But as per the doc, GET operation ("Get Node.js module dependencies") can also be used to get npm dependencies for an API Proxy which is not working. Is this method still supported?

https://apidocs.apigee.com/management/apis/get/organizations/%7Borg_name%7D/apis/%7Bapi_name%7D/revi...

Sorry, your original post said "..tried running the below command to install those dependencies via..."

and i assumed that you had trouble installing -

Can you list the content of your package.json?

@rmishra, Here is the content of package.json.

{
	"dependencies": {
		"oracledb": ""
	}
}

I have also downloaded the required npm module using "npm i -g oracledb" command. Can we attach it to API proxy offline? If yes, what are the steps?

Shouldn't the dependency version be a "*" instead of "". Something you will need to check.Just so you know, it's generally a bad idea to use floating versions in production

Have you redeployed your proxy after the modules were installed? If not, please do that.

If the above doesn't help In your private cloud, when you run the install command using the API , can you check your Management Server logs to see if its reporting any errors when you run the install command? If your management server is behind a proxy, it might have connectivity issues downloading modules.

If you have connectivity issues during the install, you have alternative approaches. You can use apigetool (node module) to package the plugin on a build server (instead of trying to download them within apigee)

Please refer https://github.com/apigee/apigeetool-node

and use the flag --upload-modules

--upload-modules -U
(optional) If specified, uploads Node.js modules from your system to Apigee Edge rather than resolving the modules directly on Apigee Edge (the default behavior).