.NETCore 3.1 のreactreudxテンプレートを,vsCodeデバッグ起動をしようとしますが、以下のエラーが発生が発生しました。いくらか調べてみたものの、結局わかりませんでした。どうかご教授をお願いします。
(1)やったこと
・npm cache clean
や、npm install
の実行。しかし、実行をいくらしても同じ結果であった。
・ Start.cs
の以下のコメントアウト:
spa.UseReactDevelopmentServer(npmScript: "start")
(参照: https://yokoken.hatenablog.com/entry/2020/01/15/102344)。これは、エラーメッセージを検索にかけてよく出る記事で、一応実行した。しかし、別のエラー、つまりミドルウエア不使用のエラーが出た。
(2)エラーの内容
An unhandled exception occurred while processing the request.
AggregateException: One or more errors occurred. (One or more errors occurred. (The NPM script 'start' exited without indicating that the create-react-app server was listening for requests. The error output was: 'rimraf' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! reared3@0.1.0 start: `rimraf ./build && react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the reared3@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
(3)フォルダ構成
├─.vscode/
├─bin/
│ └─Debug/
├─ClientApp/
│ ├─node_modules/
│ ├─public/
│ ├─src/
│ ├─package-lock.json
│ ├─package.json
│ ├─README.md
│ └─tsconfig.json
│
├─Controllers/
├─obj/
│ └─Debug/
├─Pages/
├─Properties/
├appsettings.Development.json
├appsettings.json
├Program.cs
├reared3.csproj
└Startup.cs
rimraf
実行時のカレントフォルダに./build
フォルダが無いから、ということはありませんか? あるいはこれらの記事が関連するかも。npm install succeeds but npm run start fails to find both rimraf and react-scripts despite them being installed, sh: 1: rimraf: not found whenever I run npm run build within vagrant installed on Windows 10, NPM rimraf - continue executing when folders are missing (stop exit code 1) – kunif 20年7月14日 10:13