简体   繁体   中英

How to use latest version of nodejs on azure mobile-service runtime

I am trying to integrate google-api-nodejs-client with azure mobile-services. I get following runtime error trying to use sample code from googleapis:

Error: Unable to load endpoint plus("v1"): Cannot read property 'prototype' of undefined

This error seems to be due to reason that googleapis only support nodejs version 0.10 and higher , whereas azure mobile-services are running nodejs version 0.8.28.

Is there a way I can use more latest version of nodejs on azure mobile-service?

A workaround suggested by David Ebbo on Azure Support Site

You may want to try something like this as a workaround:

at the root of the repo, you'll find a .deployment file that has:

[config]
command = ..\ZumoDeploy.cmd

Change it to

[config]
command = deploy.cmd

And create a deploy.cmd next to it containing:

set NPM_JS_PATH=%ProgramFiles(x86)%\npm\1.4.9\node_modules\npm\bin\npm-cli.js  
..\ZumoDeploy.cmd

Commit both files and push.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM