0

I was trying to install firebase for my react native project with

npm install --save firebase 

but I got errors. What worked for me was

npm install firebase --save 

for whatever reason. why? what's the difference ?!

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
farmcommand2
  • 1,418
  • 1
  • 13
  • 18

1 Answers1

0

If you go and read the documentation of these flags, you find that they also put --save/--save-dev after the package names. e.g.:

npm install sax
npm install githubname/reponame
npm install @myorg/privatepackage
npm install node-tap --save-dev
npm install dtrace-provider --save-optional
npm install readable-stream --save-exact
npm install ansi-regex --save-bundle

Another example would be this answer to the question that asks what the --save flag is used for. The answer also uses --save after the package names are listed.

All I know is that that's just how npm works. Every single example of installation I've seen has that same method of installation: npm install <package-name> <flag>. The exception being the --global flag.

Kitanga Nday
  • 3,517
  • 2
  • 17
  • 29