Cloud Functions Firebase CLI predeploy error (typescript)
Just replace inside the package.json
this
"build": "./node_modules/.bin/tslint.cmd -p tslint.json && ./node_modules/.bin/tsc.cmd"
on this
"build": ".\\node_modules\\.bin\\tslint.cmd -p tslint.json && .\\node_modules\\.bin\\tsc.cmd"
and it will work on windows.
add this line to tsconfig within the functions folder:
"typeRoots": [
"node_modules/@types"
],
This is part of "compilerOptions" block worked for me
Sorry for the delay. Andrew's answer will work, but it makes the project now only work on Windows. For more information, you can check my GitHub answer here. TL;DR:
Change the scripts in your package.json to:
"scripts": {
"lint": "./node_modules/.bin/tslint -p tslint.json",
"build": "./node_modules/.bin/tsc"
}
Change predeploy hook in your firebase.json to:
{
"functions": {
"predeploy": "npm --prefix functions run lint && npm --prefix functions run build"
}
}