[React、Scaffolding、Yarn] Webpack ルールを公開し、エラーを報告します: エラー コマンドが終了コード 1 で失敗しました。

目次

質問

  1. プロジェクトの初期化時に不要なファイルはすべて削除されるため、図に示すファイルのみが残ります(node_modules は移動されず、public 配下には、index.html と favicon.ico の 2 つのファイルだけが残ります。また、public 配下には 1 つのファイルだけが残ります)。 src:index.js)。
    ここに画像の説明を挿入
  2. 実行時:yarn eject以下の問題が発生します。
cengguilideMacBook-Pro:myapp zengguili$ yarn eject
yarn run v1.22.19
$ react-scripts eject
NOTE: Create React App 2+ supports TypeScript, Sass, CSS Modules and more without ejecting: https://reactjs.org/blog/2018/10/01/create-react-app-v2.html

✔ Are you sure you want to eject? This action is permanent. … yes
This git repository has untracked files or uncommitted changes:

README.md
D public/logo192.png
D public/logo512.png
D public/manifest.json
D public/robots.txt
D src/App.css
D src/App.js
D src/App.test.js
D src/index.css
M src/index.js
D src/logo.svg
D src/reportWebVitals.js
D src/setupTests.js

Remove untracked files, stash or commit any changes, and try again.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

解決

  1. ターミナルコマンドを入力します。
git add -A
git commit -m'init'
  1. yを選択して実行します。
  2. コマンドを再度実行すると、yarn ejectWebpack ルールが公開される可能性があります。

おすすめ

転載: blog.csdn.net/qiqizgl777/article/details/129505483