最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

react native - How to Revert `npx expo install some-package` - Stack Overflow

programmeradmin0浏览0评论

I read this article: Why You Should Use "npx expo install" instead of "npm install" in Expo React Native App.

Basically, the recommendation is to use npx expo install when possible. However, I couldn't figure out what the reverse command is for npx expo install some-package. And it's not npx expo uninstall some-package

So far, I have tried the help command:

$ npx expo install --help

  Info
    Install a module or other package to a project

  Usage
    $ npx expo install

  Options
    --check     Check which installed packages need to be updated
    --dev       Save the dependencies as devDependencies
    --fix       Automatically update any invalid package versions
    --npm       Use npm to install dependencies. Default when package-lock.json exists
    --yarn      Use Yarn to install dependencies. Default when yarn.lock exists
    --bun       Use bun to install dependencies. Default when bun.lock or bun.lockb exists
    --pnpm      Use pnpm to install dependencies. Default when pnpm-lock.yaml exists
    -h, --help  Usage info

  Additional options can be passed to the underlying install command by using --
    $ npx expo install react -- --verbose
    > yarn add react --verbose

I also tried:

$ npx expo --help

  Usage
    $ npx expo <command>

  Commands
    start, export
    run:ios, run:android, prebuild
    install, customize, config, serve
    login, logout, whoami, register

  Options
    --version, -v   Version number
    --help, -h      Usage info

  For more info run a command with the --help flag
    $ npx expo start --help

And there is no mentions about npx expo uninstall

However, I found no mention of a command like npx expo uninstall some-package.

Can anyone assist me with reverting the installation of a package using Expo? What methods do others use to accomplish this? Should I simply run npm remove some-package, or would it be better to use git revert?

I read this article: Why You Should Use "npx expo install" instead of "npm install" in Expo React Native App.

Basically, the recommendation is to use npx expo install when possible. However, I couldn't figure out what the reverse command is for npx expo install some-package. And it's not npx expo uninstall some-package

So far, I have tried the help command:

$ npx expo install --help

  Info
    Install a module or other package to a project

  Usage
    $ npx expo install

  Options
    --check     Check which installed packages need to be updated
    --dev       Save the dependencies as devDependencies
    --fix       Automatically update any invalid package versions
    --npm       Use npm to install dependencies. Default when package-lock.json exists
    --yarn      Use Yarn to install dependencies. Default when yarn.lock exists
    --bun       Use bun to install dependencies. Default when bun.lock or bun.lockb exists
    --pnpm      Use pnpm to install dependencies. Default when pnpm-lock.yaml exists
    -h, --help  Usage info

  Additional options can be passed to the underlying install command by using --
    $ npx expo install react -- --verbose
    > yarn add react --verbose

I also tried:

$ npx expo --help

  Usage
    $ npx expo <command>

  Commands
    start, export
    run:ios, run:android, prebuild
    install, customize, config, serve
    login, logout, whoami, register

  Options
    --version, -v   Version number
    --help, -h      Usage info

  For more info run a command with the --help flag
    $ npx expo start --help

And there is no mentions about npx expo uninstall

However, I found no mention of a command like npx expo uninstall some-package.

Can anyone assist me with reverting the installation of a package using Expo? What methods do others use to accomplish this? Should I simply run npm remove some-package, or would it be better to use git revert?

Share Improve this question asked Feb 6 at 6:03 sultanmyrzasultanmyrza 5,4121 gold badge33 silver badges28 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

The command

npx expo install some-package

finds compatible version of some-package with your expo version. Under the hood it runs:

npm install some-package@version

Therefore just use

npm uninstall some-package

发布评论

评论列表(0)

  1. 暂无评论