34

When creating an react native app with expo, expo installs many module that i don't need. Is there a way to remove these unwanted modules like barcode reader google sign in and google maps. thanks

4
  • 2
    Unfortunately removing Universal Modules and ExpoKit Modules is not that straight forward.Check out this document docs.expo.io/versions/latest/expokit/…
    – mcnk
    Commented Aug 24, 2019 at 10:59
  • You could remove them with Yarn remove. Expo uses Yarn.
    – FabricioG
    Commented Apr 14, 2020 at 1:10
  • Did you solve the issue?@picacode
    – PvUIDev
    Commented Apr 10, 2021 at 15:19
  • Hi @pvuidev you can now remove them simply by using npm uninstall or yarn remove check out @akshay-i 's answer, but be careful if you are using OTA docs.expo.io/versions/latest/expokit/…
    – mcnk
    Commented Apr 11, 2021 at 21:06

3 Answers 3

39

To remove a package from your node_modules directory, on the command line, use the uninstall command. Include the scope of the package is scoped.

Unscoped package

npm uninstall --save <package_name>

Scoped package

npm uninstall --save <@scope/package_name>

if need to know more about it then follow official Document here https://docs.npmjs.com/uninstalling-packages-and-dependencies#removing-a-local-package-from-the-packagejson-dependencies

1
  • 4
    It is really strange but command "npm uninstall package-name" doesn't delete packege from folder and doesn't delete it from package.json.
    – Kate
    Commented Jun 12, 2021 at 16:52
12

npm uninstall <package name> works. It removes the expo module from your node_modules

for more reference https://docs.npmjs.com/uninstalling-packages-and-dependencies

1
  • 1
    or yarn remove <package name> if you use Yarn
    – Kewal Shah
    Commented Jun 28, 2020 at 11:46
8

With NPM

$ npm uninstall jest

Shorthand version

$ npm r jest

With Yarn

$ yarn remove jest
1
  • 1
    I tried this after expo install expo-camera, but then if I wanted to install another module I get PluginError: Failed to resolve plugin for module "expo-camera" relative to ... I had to go to app.json (in project root) and remove "expo-camera" from the "plugins" array
    – jave.web
    Commented Feb 2, 2022 at 20:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.