nuxt.jsの開発環境でで以下を実行したらエラーが出ました。
$ npm run dev
:
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?
:
結論
以下のコマンドを実行したら解決しました。一度消去後に再インストールしてます。
$ rm -rf node_modules
$ rm package-lock.json yarn.lock
$ npm cache clear --force
$ npm install
コマンド実行前もインストールされているはずでしたが、バージョンの違いでエラーが出る場合があるので一度消去して、再インストールしたらいけました!バージョンは変化していませんが、node?のバージョンが変化してのでしょうか。
詳しい方いたらご指摘いただけると幸いです。
$ npm -v
6.14.7
// 上記のコード実行後
$ npm -v
6.14.7