expo install development dependencies

Viewed 909

Using Expo Go in bare workflow, per the docs it is recommended to prefer expo install of the Expo CLI over npm install when installing dependencies. expo install, however, always installs in production dependencies.

Is there an equivalent to npm install --save-dev?

I don't seem to find one so the only solution I currently see is, after having installed using expo install, moving the dependency to devDependencies and running npm install again.

2 Answers

From expo install --help command :

Additional options can be passed to the npm install or yarn add command by using -- For example: expo install somepackage -- --verbose

So you can do expo install {packageName} -- --save-dev with npm or expo install {packageName} -- --dev with yarn

expo install is a command which will use your default package manager only. So, if you use npm, then what expo install actually does is, it searches for the compatible version of a dependency with your project and then installs it with npm. so, you may as well use npm install --save-dev. I personally use npm for all my expo project, and there are no issues.

Related