1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【npm】Local package.json exists, but node_modules missing, did you mean to install?の対処法

Posted at

症状

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

参考

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?