twilio / voice-quickstart-server-node

voice quickstart server example in node
MIT License
24 stars 37 forks source link

Update .nvmrc to a working version #14

Closed Joe0 closed 5 years ago

Joe0 commented 5 years ago

.nvmrc version is too old and when using the version specified the project will not run.

Contributing to Twilio

All third-party contributors acknowledge that any contributions they provide will be made under the same open-source license that the open-source project is provided under.

bobiechen-twilio commented 5 years ago

Hi @Joe0

Could you please share any error/warning or more information when the project failed to run?

Thanks -bobie

Joe0 commented 5 years ago

Error:

$ node .
./voice-quickstart-server-node/src/server.js:99
async function placeCall(request, response) {
      ^^^^^^^^
SyntaxError: Unexpected token function
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:542:28)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (./voice-quickstart-server-node/index.js:7:17)

async function placeCall(request, response) is causing an error, because node v6.10.2 doesn't support async/await. Using a more modern version of node solves the problem, so I just bumped the version specified in the .nvmrc.

I just realized that the change should also be reflected in the package.json. I'll amend the PR to reflect that.

charliesantos commented 5 years ago

Thanks @Joe0 , this looks good. Merging..