目的
- Laravelアプリに必要なJSパッケージをインストールするためにnpm installを実行したがエラーが出た話をまとめる
問題までの経緯
-
Laravelアプリ名ディレクトリの一つ上の階層で下記コマンドを実行した。
$ npm install
問題
-
下記エラーが発生しコマンドが正常実行されない。
npm WARN saveError ENOENT: no such file or directory, open '/usr/share/nginx/html/package.json' npm WARN enoent ENOENT: no such file or directory, open '/usr/share/nginx/html/package.json' npm WARN html No description npm WARN html No repository field. npm WARN html No README data npm WARN html No license field. audited 15 packages in 0.511s 3 packages are looking for funding run `npm fund` for details found 0 vulnerabilities
問題解決までの経緯
-
$ npm install
を実行するディレクトリを間違えていた。 - Laravelアプリ名ディレクトリに移動して
$ npm install
を実行したところ正常に実行された。