cloud-functions-emulator
cloud-functions-emulator copied to clipboard
Cannot install functions emulator
Version info
$ firebase --version
4.1.1
Platform Information
OS X
Steps to reproduce
I've got Node 8 installed, and my functions use Node 8 features.
Expected behavior
It installs.
Actual behavior
$ yarn global add @google-cloud/functions-emulator
yarn global v1.9.4
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
warning Pattern ["@google-cloud/functions-emulator@^1.0.0-beta.5"] is trying to unpack in the same destination "/Users/chris/Library/Caches/Yarn/v2/npm-@google-cloud/functions-emulator-1.0.0-beta.5-08aa14a007b739aadcf7296e0b4354cd8a8d81df" as pattern ["@google-cloud/functions-emulator@^1.0.0-beta.4"]. This could result in non-deterministic behavior, skipping.
info @google-cloud/[email protected]: The engine "node" is incompatible with this module. Expected version "~6".
info "@google-cloud/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
error @google-cloud/[email protected]: The engine "node" is incompatible with this module. Expected version "~6".
error Found incompatible module
info Visit https://yarnpkg.com/en/docs/cli/global for documentation about this command.
+1
I ran into a similar issue when using yarn, a temporary workaround is to include the --ignore-engines flag when adding the emulator (yarn global add @google-cloud/functions-emulator --ignore-engines).
Same here for node v9.11.2 via nvm and firebase 4.1.0. This problem seems to prevent me from using firebase serve for functions or firebase functions:shell :(
That's really strange that such an important part of Functions development is depending on such old version of Node :( Apparently, the emulator can run even under node 10.4.1 that I do have installed, so why not just remove the constraint from package.json? Using --ignore-engines did help indeed, but it's rather cumbersome to remember use it every time when installing some package.
Any news on this? I'm using Node 8 and have to add --ignore-engines every time I do anything with yarn.
Not to take away someone else's credit but... I believe this to be fixed as of 098e2531!
Until it have been released though, you can also do echo ignore-engines true >> .yarnrc if you've grown tired of --ignore-engines. ;)
That doesn't fix the install constraint. Thanks for the .yarnrc trick though.