When I attempt to firebase deploy
I get the following error.
It seems to be about this line: import * as functions from 'firebase-functions';
at the begining of my file. I have not had any issues with this in the past. But I have recently been having issues with NPM and deploying.
Error: Error occurred while parsing your function triggers.
/Users/name/Desktop/Yoveo/functions/src/index.ts:1
import * as functions from 'firebase-functions';
^^^^^^
SyntaxError: Cannot use import statement outside a module
at wrapSafe (internal/modules/cjs/loader.js:1052:16)
at Module._compile (internal/modules/cjs/loader.js:1100:27)
at Module._compile (pkg/prelude/bootstrap.js:1281:32)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1156:10)
at Module.load (internal/modules/cjs/loader.js:984:32)
at Function.Module._load (internal/modules/cjs/loader.js:877:14)
at Module.require (internal/modules/cjs/loader.js:1024:19)
at Module.require (pkg/prelude/bootstrap.js:1225:31)
at require (internal/modules/cjs/helpers.js:72:18)
at /Users/name/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/triggerParser.js:15:15
Having trouble? Try firebase [command] --help
name@name-MacBook-Pro functions %
How can I fix it?
I ran npm update and then ran firebase deploy again. got the same error. But with a recommendation to run npm install -g firebase-tools which after running deploy again, resulted in no change for the error.