Error deploying with firebase on npm --prefix $RES

2019-01-10 22:23发布

I have a fresh install of firebase tools (following this tutorial) and I'm trying to upload my first firebase function. I get this issue with the hello-world example that they initialise when you run firebase init (The only set up the functions CLI feature during the init)

If I replace $RESOURCE_DIR in firebase.json with my functions folder it works, but of course that Is bad practice and I'd like to find a proper $RESOURCE_DIR replacement that works.

PS D:\workspace\firebase-functions> firebase deploy

    === Deploying to 'newagent-5221d'...

i  deploying functions
Running command: npm --prefix $RESOURCE_DIR run lint
npm ERR! path D:\workspace\firebase-functions\$RESOURCE_DIR\package.json
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open 'D:\workspace\firebase-functions\$RESOURCE_DIR\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\dtlut\AppData\Roaming\npm-cache\_logs\2018-01-19T15_57_22_990Z-debug.log

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

7条回答
放荡不羁爱自由
2楼-- · 2019-01-10 22:50

locate the firebase.json file and then change these lines

"npm --prefix \"$RESOURCE_DIR\" run lint",
"npm --prefix \"$RESOURCE_DIR\" run build"

to

"npm --prefix \"%RESOURCE_DIR%\" run lint",
"npm --prefix \"%RESOURCE_DIR%\" run build"

it'll work

查看更多
登录 后发表回答