0
0

More than 3 years have passed since last update.

node.jsでnpm run devがエラーになった場合の対処法

Posted at

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
0
0
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
0
0