Vue.js + Spring Boot + Heroku(Herokuへデプロイ〜環境毎プロパティファイル作成)の記事を作成した際に Herokuのビルドでpackage.jsonが見つからないエラーが出たのでメモ
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | remote:        [INFO] --- frontend-maven-plugin:1.10.0:npm (npm install --prefix ./src/vue/) @ demo --- remote:        [INFO] Running 'npm install --prefix ./src/vue/' in /tmp/build_d773c346 remote:        [INFO] npm WARN saveError ENOENT: no such file or directory, open '/tmp/build_d773c346/src/vue/package.json' remote:        [INFO] npm notice created a lockfile as package-lock.json. You should commit this file. remote:        [INFO] npm WARN enoent ENOENT: no such file or directory, open '/tmp/build_d773c346/src/vue/package.json' remote:        [INFO] npm WARN vue No description remote:        [INFO] npm WARN vue No repository field. remote:        [INFO] npm WARN vue No README data remote:        [INFO] npm WARN vue No license field. remote:        [INFO]  remote:        [INFO] up to date in 0.223s remote:        [INFO] found 0 vulnerabilities remote:        [INFO]  remote:        [INFO]  remote:        [INFO] --- frontend-maven-plugin:1.10.0:npm (npm run build --prefix ./src/vue/) @ demo --- remote:        [INFO] Running 'npm run build --prefix ./src/vue/' in /tmp/build_d773c346 remote:        [INFO] npm ERR! code ENOENT remote:        [INFO] npm ERR! syscall open remote:        [INFO] npm ERR! path /tmp/build_d773c346/src/vue/package.json remote:        [INFO] npm ERR! errno -2 remote:        [INFO] npm ERR! enoent ENOENT: no such file or directory, open '/tmp/build_d773c346/src/vue/package.json' remote:        [INFO] npm ERR! enoent This is related to npm not being able to find a file. remote:        [INFO] npm ERR! enoent  remote:        [INFO]  remote:        [INFO] npm ERR! A complete log of this run can be found in: remote:        [INFO] npm ERR!     /app/.npm/_logs/2020-09-05T07_09_35_514Z-debug.log remote:        [INFO] ------------------------------------------------------------------------ remote:        [INFO] BUILD FAILURE remote:        [INFO] ------------------------------------------------------------------------ remote:        [INFO] Total time:  16.506 s remote:        [INFO] Finished at: 2020-09-05T07:09:35Z remote:        [INFO] ------------------------------------------------------------------------ remote:        [ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.10.0:npm (npm run build --prefix ./src/vue/) on project demo: Failed to run task: 'npm run build --prefix ./src/vue/' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 254 (Exit value: 254) -> [Help 1] remote:        [ERROR]  remote:        [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. remote:        [ERROR] Re-run Maven using the -X switch to enable full debug logging. remote:        [ERROR]  remote:        [ERROR] For more information about the errors and possible solutions, please read the following articles: remote:        [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException | 
vueディレクトリ配下がファイルとして認識されいるので、一旦gitから削除して再登録。
| 1 2 3 4 5 | $ git rm -rf --cached src/vue $ git add src/vue/package.json  $ git add . $ git commit -am "make it better" $ git push heroku master |