Friday 9 June 2017

Function Deploy error for google home app

ERROR: Function load error: Code could not be loaded.
ERROR: Does the file exists? Is there a syntax error in your code?
ERROR: Detailed stack trace: module.js:487
    throw err;
    ^

Error: Cannot find module 'actions-on-google'
at Function.Module._resolveFilename (module.js:485:15)
at Function.Module._load (module.js:437:25)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/Users/User/Desktop/project-dir/index.js:5:13)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)

ERROR: Error: Failed to deploy function.
at exec (/Users/demaabuadas/.nvm/versions/node/v8.0.0/lib/node_modules/@google-cloud/functions-emulator/src/cli/controller.js:135:18)
at ChildProcess.exithandler (child_process.js:259:5)
at emitTwo (events.js:125:13)
at ChildProcess.emit (events.js:213:7)
at maybeClose (internal/child_process.js:887:16)
at Socket.stream.socket.on (internal/child_process.js:340:11)
at emitOne (events.js:115:13)
at Socket.emit (events.js:210:7)
at Pipe._handle.close [as _onclose] (net.js:546:12)

I get this error when i try to function deploy, I am unsure what is causing it.. my package.json contents are:

  "scripts": {
"lint": "semistandard --fix \"**/*.js\"",
"start": "functions deploy functionName --trigger-http",
"deploy": "gcloud beta functions deploy functionName --trigger-http --stage-bucket bucket-name"
   },
   "dependencies": {
"@google/maps": "^0.3.1",
"actions-on-google": "^1.0.0",
"forecast": "^0.3.2",
"google-distance": "^1.0.1"
   },
 "devDependencies": {
"semistandard": "^9.1.0"
   }

I dont think I have a random syntax error, because I have used the gcloud beta function and uploaded it to a the google functions cloud and it worked on the simulator.. What i am trying to do is deploy the app but privately.



via Dema

No comments:

Post a Comment