Q:

Just Upgraded Firebase Functions and Getting an Error

I'm trying to upgrade from Node 6 to Node 8 and I'm following the docs. I just updated my firebase-tools and firebase-functions in the CLI, and added "engines": { "node": "8" } to my project/functions package.json file and I'm getting the following errors:
PS C:\program files\git\projects\qmn> firebase deploy

=== Deploying to 'quizmenot-79ee9'...

i  deploying storage, firestore, functions, hosting
Running command: npm --prefix "$RESOURCE_DIR" run build

> functions@ build C:\program files\git\projects\qmn\functions
> tsc

node_modules/firebase-functions/lib/function-builder.d.ts(61,93): error TS1005: ';' expected.
node_modules/firebase-functions/lib/function-builder.d.ts(61,94): error TS1003: Identifier expected.
node_modules/firebase-functions/lib/function-builder.d.ts(61,114): error TS1005: ';' expected.
node_modules/gaxios/build/src/index.d.ts(14,66): error TS1005: '>' expected.
node_modules/gaxios/build/src/index.d.ts(14,103): error TS1109: Expression expected.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! functions@ build: `tsc`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the functions@ build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\FiringBlanks\AppData\Roaming\npm-cache\_logs\2019-04-19T05_57_15_561Z-debug.log

Error: functions predeploy error: Command terminated with non-zero exit code2

More log info from C:\Users\FiringBlanks\AppData\Roaming\npm-cache\_logs
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   '--prefix',
1 verbose cli   'C:\\program files\\git\\projects\\qmn\\functions',
1 verbose cli   'run',
1 verbose cli   'build' ]
2 info using npm@6.4.1
3 info using node@v8.12.0
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle functions@~prebuild: functions@
6 info lifecycle functions@~build: functions@
7 verbose lifecycle functions@~build: unsafe-perm in lifecycle true
8 verbose lifecycle functions@~build: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\program files\git\projects\qmn\functions\node_modules\.bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Users\FiringBlanks\AppData\Local\Microsoft\WindowsApps;C:\Users\FiringBlanks\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\FiringBlanks\AppData\Roaming\npm;C:\Users\FiringBlanks\AppData\Local\Google\Cloud SDK\google-cloud-sdk\bin
9 verbose lifecycle functions@~build: CWD: C:\program files\git\projects\qmn\functions
10 silly lifecycle functions@~build: Args: [ '/d /s /c', 'tsc' ]
11 silly lifecycle functions@~build: Returned: code: 2  signal: null
12 info lifecycle functions@~build: Failed to exec build script
13 verbose stack Error: functions@ build: `tsc`
13 verbose stack Exit status 2
13 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at EventEmitter.emit (events.js:214:7)
13 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at ChildProcess.emit (events.js:214:7)
13 verbose stack     at maybeClose (internal/child_process.js:915:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid functions@
15 verbose cwd C:\program files\git\projects\qmn
16 verbose Windows_NT 10.0.17134
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "--prefix" "C:\\program files\\git\\projects\\qmn\\functions" "run" "build"
18 verbose node v8.12.0
19 verbose npm  v6.4.1
20 error code ELIFECYCLE
21 error errno 2
22 error functions@ build: `tsc`
22 error Exit status 2
23 error Failed at the functions@ build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 2, true ]

A:

Found the solution here: https://github.com/firebase/firebase-functions/issues/404
It's a typescript version issue. The latest (3.4.4) doesn't work. Installing v3.3.1 instead works. I used the following:
npm install --save typescript@3.3.1

and
npm install --save-dev typescript@3.3.1

in both my current project's root folder and it's /functions directory.
It deploys just fine now.

