症状
npmstartをしたところ下記のエラーメッセージが表示されました。 warnを翻訳したところ、「ローカルのpackage.jsonは存在しますが、node_modulesがありません。インストールするつもりでしたか?」となりました。error
npm start
> frontend@0.1.0 start D:\mogumogu\frontend
> react-scripts start
'react-scripts' は、内部コマンドまたは外部コマンド、
操作可能なプログラムまたはバッチ ファイルとして認識されていません。
npm ERR! errno 1
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the frontend@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\natum\AppData\Roaming\npm-cache\_logs\2021-09-03T09_06_24_971Z-debug.log
解決策
npminstallしたら、エラーが表示されなくなりました。 参考にしたサイトによると、「npm installはpackage.jsonに記述されている依存パッケージを自動でインストールしてくれる」らしいです。npminstall
npm install
参考