firebase-tools: 6.10.0
Platform: Windows
run firebase deploy on an index.js that contains
const language = require('@google-cloud/language');
See above
Deploy
Received the following error:
Error: Error occurred while parsing your function triggers.
Error: @grpc/grpc-js only works on Node ^8.13.0 || >=10.10.0
at Object.<anonymous> (C:\Users\tyler\node_modules\@grpc\grpc-js\build\src\index.js:45:11)
at Module._compile (module.js:643:30)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
at Module.require (module.js:587:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (C:\Users\tyler\node_modules\google-gax\build\src\grpc.js:37:14)
at Module._compile (module.js:643:30)
Having trouble? Try firebase deploy --help
Tried installing latest @grpc/grpc-js
Tried setting
"engines": {
"node": "^8.13.0"
}
in package.json but when I do that it says
Error: package.json in functions directory has an engines field which is unsupported. The only valid choices are: {"node": "8"} and {"node": "10"}. Note that Node.js 6 is now deprecated.
This issue does not seem to follow the issue template. Make sure you provide all the required information.
@tylerburleigh have you tried following the suggestion in the error message and setting {"node": "8"} in your engines field?
Hey @tylerburleigh. We need more information to resolve this issue but there hasn't been an update in 7 days. I'm marking the issue as stale and if there are no new updates in the next 3 days I will close it automatically.
If you have more information that will help us get to the bottom of this, just add a comment!
We have the same issue. @grpc/grpc-js complains:
error @google-cloud/[email protected]: The engine "node" is incompatible with this module. Expected version "^8.13.0 || >=10.10.0".
In our package.json we have
"engines": {
"node": "8"
}
We can't use semver there ({ "node": "^8.13.0 || >=10.10.0" }) because of a weird design choice that firebase deploy only accepts integral numbers which doesn't conform to the package.json schema for the engines field. 馃檮
I get the same message as @Robula when using {"node": "8"} in the engines field.
Thanks for the feedback, folks. We're talking through how we might address this issue. The problem is that since our different runtimes are in different release stages (Node.js 8 is general availability, Node.js 10 is beta), we very much want to avoid accidentally selecting the wrong runtime via e.g. an unexpectedly loose semver string.
That being said, we also don't intend to break people using libraries with specific engines requirements. Hope to have more soon.
FWIW we weren't trying to to be non-conformant, and the guidance on NPM's website seems to indicate that bare integer values should be interpreted as "any minor version in that major".
But clearly something is being either miscommunicated or there's a bug in some underlying system.
I'm leaning more and more toward bug in an underlying system. To anyone experiencing this issue: are you using Yarn to manage packages locally? Can you provide me with the full output from firebase deploy --debug?
I don't think I'm using Yarn. I don't use Node.js much but I installed everything with npm.
Here's debug output with "node": "8":
> firebase deploy --debug
[2019-06-17T22:39:58.219Z] ----------------------------------------------------------------------
[2019-06-17T22:39:58.223Z] Command: C:\Program Files\nodejs\node.exe C:\Users\tyler\AppData\Roaming\npm\node_modules\firebase-tools\lib\bin\firebase.js deploy --debug
[2019-06-17T22:39:58.224Z] CLI Version: 6.10.0
[2019-06-17T22:39:58.224Z] Platform: win32
[2019-06-17T22:39:58.224Z] Node Version: v8.9.4
[2019-06-17T22:39:58.227Z] Time: Mon Jun 17 2019 18:39:58 GMT-0400 (Eastern Daylight Time)
[2019-06-17T22:39:58.227Z] ----------------------------------------------------------------------
[2019-06-17T22:39:58.246Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[2019-06-17T22:39:58.247Z] > authorizing via signed-in user
[2019-06-17T22:39:58.248Z] [iam] checking project myfirebase for permissions ["cloudfunctions.functions.create","cloudfunctions.functions.delete","cloudfunctions.functions.get","cloudfunctions.functions.list","cloudfunctions.functions.update","cloudfunctions.operations.get","firebase.projects.get"]
[2019-06-17T22:39:58.250Z] >>> HTTP REQUEST POST https://cloudresourcemanager.googleapis.com/v1/projects/myfirebase:testIamPermissions
permissions=[cloudfunctions.functions.create, cloudfunctions.functions.delete, cloudfunctions.functions.get, cloudfunctions.functions.list, cloudfunctions.functions.update, cloudfunctions.operations.get, firebase.projects.get]
[2019-06-17T22:39:58.502Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Mon, 17 Jun 2019 22:39:58 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, server-timing=gfet4t7; dur=159, alt-svc=quic=":443"; ma=2592000; v="46,44,43,39", accept-ranges=none, transfer-encoding=chunked
! functions: package.json indicates an outdated version of firebase-functions.
Please upgrade using npm install --save firebase-functions@latest in your functions directory.
=== Deploying to 'myfirebase'...
i deploying functions
[2019-06-17T22:40:04.275Z] > [functions] package.json contents: {
"name": "functions",
"description": "Cloud Functions for Firebase",
"scripts": {
"serve": "firebase serve --only functions",
"shell": "firebase functions:shell",
"start": "npm run shell",
"deploy": "firebase deploy --only functions",
"logs": "firebase functions:log"
},
"engines": {
"node": "8"
},
"dependencies": {
"actions-on-google": "^2.7.0",
"firebase-admin": "~7.0.0",
"firebase-functions": "^2.3.0"
},
"devDependencies": {
"firebase-functions-test": "^0.1.6"
},
"private": true
}
i functions: ensuring necessary APIs are enabled...
[2019-06-17T22:40:04.278Z] >>> HTTP REQUEST GET https://servicemanagement.googleapis.com/v1/services/cloudfunctions.googleapis.com/projectSettings/myfirebase?view=CONSUMER_VIEW
[2019-06-17T22:40:04.290Z] >>> HTTP REQUEST GET https://servicemanagement.googleapis.com/v1/services/runtimeconfig.googleapis.com/projectSettings/myfirebase?view=CONSUMER_VIEW
[2019-06-17T22:40:04.964Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Mon, 17 Jun 2019 22:40:04 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,44,43,39", accept-ranges=none, transfer-encoding=chunked
[2019-06-17T22:40:05.160Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Mon, 17 Jun 2019 22:40:05 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,44,43,39", accept-ranges=none, transfer-encoding=chunked
+ functions: all necessary APIs are enabled
[2019-06-17T22:40:05.167Z] >>> HTTP REQUEST GET https://cloudresourcemanager.googleapis.com/v1/projects/myfirebase
[2019-06-17T22:40:05.374Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Mon, 17 Jun 2019 22:40:05 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, server-timing=gfet4t7; dur=169, alt-svc=quic=":443"; ma=2592000; v="46,44,43,39", accept-ranges=none, transfer-encoding=chunked
[2019-06-17T22:40:05.384Z] >>> HTTP REQUEST GET https://mobilesdk-pa.googleapis.com/v1/projects/167947889773:getServerAppConfig
[2019-06-17T22:40:05.604Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Mon, 17 Jun 2019 22:40:05 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,44,43,39", accept-ranges=none, transfer-encoding=chunked
i functions: preparing functions directory for uploading...
[2019-06-17T22:40:05.619Z] >>> HTTP REQUEST GET https://runtimeconfig.googleapis.com/v1beta1/projects/myfirebase/configs
[2019-06-17T22:40:05.758Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Mon, 17 Jun 2019 22:40:05 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,44,43,39", accept-ranges=none, transfer-encoding=chunked
Error: Error occurred while parsing your function triggers.
Error: @grpc/grpc-js only works on Node ^8.13.0 || >=10.10.0
at Object.<anonymous> (C:\Users\tyler\node_modules\@grpc\grpc-js\build\src\index.js:45:11)
at Module._compile (module.js:643:30)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
at Module.require (module.js:587:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (C:\Users\tyler\node_modules\google-gax\build\src\grpc.js:37:14)
at Module._compile (module.js:643:30)
Hey guys, I figured this out on my MAC machine.
Here's what I did:
curl -ksO https://gist.githubusercontent.com/nicerobot/2697848/raw/uninstall-node.sh
chmod +x ./uninstall-node.sh
./uninstall-node.sh
rm uninstall-node.sh
"brew unlink node", then "brew install node@8", then "brew link node@ --force"
Verify package.json set to:
"engines": {
"node": "8"
}
yarn firebase-deploy
Works perfectly now.
@tylerburleigh you need to update your local Node version -- you have 8.9.4 but grpc-js requires8.13.0 or greater
This issue appears to be resolved. Please re-open if anyone is still experiencing issues with this.
I'm also experiencing this issue. My node version is v11.15.0
@tylerburleigh you need to update your local Node version -- you have
8.9.4butgrpc-js requires8.13.0 or greater
This solved my issue. Thanks @mbleigh
Most helpful comment
I'm also experiencing this issue. My node version is
v11.15.0