0

I am trying to run the firebase emulators using

firebase emulators:start

however this is the error I get

Error: Could not spawn java -version. Please make sure Java is installed and on your system PATH.

I then run

npm install java

I cannot install java.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
pblake586
  • 11
  • 2
  • What is the reason you can't install Java? The npm java is not the Java SDK IIUC, you may need to install the Java SDK before running `npm install java`. – Chris Aug 11 '22 at 21:34
  • Do you have Java installed on your system? The npm package `java` is just a `Bridge API to connect with existing Java APIs` as the npm description says. You need the Java binaries on your system as well. It might be, that Java is not installed or the executable is not accessible since the PATH environment variable ([see explanation here](https://superuser.com/a/284351) does not point to the folder containing the executable. – Pascal Aug 15 '22 at 09:23
  • Pascal is correct. That fixed my error. – pblake586 Nov 08 '22 at 05:22

1 Answers1

1

try this command line

sudo apt install default-jre

then run the command

firebase emulators:start
Soviut
  • 88,194
  • 49
  • 192
  • 260
IDKWYA
  • 11
  • 1
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Sep 20 '22 at 08:07