-
Notifications
You must be signed in to change notification settings - Fork 970
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deploy error on Windows: "Running command: npm --prefix "$RESOURCE_DIR" run lint" #822
Comments
What's your firebase-tools version? Run "firebase --version" |
And what does your "firebase.json" look like? |
And what is your platform? (Windows vs OS X) |
I am on windows 10 This is how my firebase.json looks like { |
@laurenzlong I was able to deploy my static pages successfully but when i am trying to deploy firebase functions I am getting errors.. and now I am getting the following errors: G:\HelpBaba>firebase deploy === Deploying to 'help-baba'... i deploying database, functions, hosting
Oops! Something went wrong! :( ESLint: 5.1.0. npm ERR! Windows_NT 10.0.17134 npm ERR! Please include the following file with any support request: Error: functions predeploy error: Command terminated with non-zero exit code1 Having trouble? Try firebase deploy --help when i do "firebase serve --only hosting,functions" everything works fine locally. Error occurs when deploying. |
Thanks for posting, looks like the pre-deploy linting script that was set up by "firebase init" is not behaving well. I'll have to debug further as to why that's happening on windows (I thought we had fixed it). In the meanwhile, you can just delete the following from firebase.json:
|
I think I figured out what's going on. Windows PowerShell has a different syntax for environment variables than Windows Cmd.exe/Command Prompt. It uses the syntax In the April update to Windows 10, Microsoft made PowerShell the default command line app, which is probably why there's so many users that have run into this issue lately. If you are a Windows user, and you are running into this bug, you have a couple of options.
This should hopefully unblock affected users while we try to fix this. If anyone has suggestions on how to make a script work across platforms and across command line tools, please share! |
Thank you very much for the help. It worked! really appreciate your help!
|
You're welcome! I'm going to reopen the issue so people can see the workaround. I'm also modifying the behavior of "firebase init" so it doesn't create the predeploy script by default (#836), to lower the number of people that will run into this. |
Not sure if I understood your previous comment fully, but as #836 already merged I assumed you this is fixed, however Functions still has this enabled by default:
|
@hgghyxo Was the project initialized before or after you upgraded firebase-tools? |
after :) but to make sure, just run an new test, empty dir, new |
Oh I see, you are using TypeScript. For TypeScript, we still default to true for linting, because a pre-deploy hook is already required for building the source code prior to deployment. If this is causing you issues, you can replace |
Thanks for the workaround, But It's such a bad experience getting started |
Just to note that I'm using Powershell, Firebase-Tools 4.2.0, Node Js 8.11.4 I tried the one below and it doesn't work. :(
This works: :)
|
I am seeing this issue on Window 8.1 pro with latest 6.0.0 firebase-tools. Also, when I googled this issue, I first found an earlier bug (#610) opened Jan 18th which was closed as a duplicate of this bug opened July 9th. That initially cause some additional confusion because I thought the issue was fixed. The original bug should have been left open. |
"functions": { This works for me.. |
Closing since we don't have a permanent fix on the immediate horizon. Please see discussions and links for workarounds. If none of the workarounds work, please open a new issue with your exact problem. |
Run npm install from within your functions directory to make sure you have the correct node modules installed for your functions. |
I deleted this and error is gone |
Hola Tengo un problema con el firebase deploy === Deploying to 'firestore-grafica-fortunatoho'... i deploying functions To see a list of supported npm commands, run: Error: spawn npm --prefix C:\ProyectosAngular_Fortunato\Angular Avanzado\goty-backend\functions run lint ENOENT Error: functions predeploy error: Command terminated with non-zero exit code 1 |
@FortunatoHernandezJr |
Me ayudo esta solución en el archivo firebase.json, --> borra "npm --prefix "$RESOURCE_DIR" run lint" esta línea desde aquí ... |
=== Deploying to 'help-baba'...
i deploying functions, hosting
Running command: npm --prefix "$RESOURCE_DIR" run lint
npm ERR! Windows_NT 10.0.17134
npm ERR! argv "D:\installationFolder\nodejs\node.exe" "D:\installationFolder\nodejs\node_modules\npm\bin\npm-cli.js" "--prefix" "%RESOURCE_DIR%" "run" "lint"
npm ERR! node v6.11.5
npm ERR! npm v3.10.10
npm ERR! path G:\HelpBaba%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 'G:\HelpBaba%RESOURCE_DIR%\package.json'
npm ERR! enoent ENOENT: no such file or directory, open 'G:\HelpBaba%RESOURCE_DIR%\package.json'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! Please include the following file with any support request:
npm ERR! G:\HelpBaba\npm-debug.log
Error: functions predeploy error: Command terminated with non-zero exit code4294963238
I am trying to deploy on firebase but its giving this error. Please Help!
The text was updated successfully, but these errors were encountered: