質問編集履歴

1

エラー文の詳細、追加検証の結果を追記

2022/05/11 01:28

投稿

xinome
xinome

スコア20

test CHANGED
File without changes
test CHANGED
@@ -26,3 +26,150 @@
26
26
  "start": "node server.js"
27
27
  },
28
28
  ```
29
+
30
+ (05/11追記)
31
+ デプロイ時のエラー文を掲載します。
32
+
33
+ ```
34
+ Enumerating objects: 426, done.
35
+ Counting objects: 100% (426/426), done.
36
+ Delta compression using up to 8 threads
37
+ Compressing objects: 100% (390/390), done.
38
+ Writing objects: 100% (426/426), 322.81 KiB | 4.75 MiB/s, done.
39
+ Total 426 (delta 255), reused 0 (delta 0), pack-reused 0
40
+ remote: Compressing source files... done.
41
+ remote: Building source:
42
+ remote:
43
+ remote: -----> Building on the Heroku-20 stack
44
+ remote: -----> Using buildpacks:
45
+ remote: 1. heroku/nodejs
46
+ remote: 2. https://github.com/heroku/heroku-buildpack-static
47
+ remote: -----> Node.js app detected
48
+ remote:
49
+ remote: -----> Build failed
50
+ remote: ! Two different lockfiles found: package-lock.json and yarn.lock
51
+ remote:
52
+ remote: Both npm and yarn have created lockfiles for this application,
53
+ remote: but only one can be used to install dependencies. Installing
54
+ remote: dependencies using the wrong package manager can result in missing
55
+ remote: packages or subtle bugs in production.
56
+ remote:
57
+ remote: - To use npm to install your application's dependencies please delete
58
+ remote: the yarn.lock file.
59
+ remote:
60
+ remote: $ git rm yarn.lock
61
+ remote:
62
+ remote: - To use yarn to install your application's dependencies please delete
63
+ remote: the package-lock.json file.
64
+ remote:
65
+ remote: $ git rm package-lock.json
66
+ remote:
67
+ remote: https://help.heroku.com/0KU2EM53
68
+ remote:
69
+ remote: ! Push rejected, failed to compile Node.js app.
70
+ remote:
71
+ remote: ! Push failed
72
+ remote: !
73
+ remote: ! ## Warning - The same version of this code has already been built: b88f01142fea6495c2deb38e4d77afd41bd9088c
74
+ remote: !
75
+ remote: ! We have detected that you have triggered a build from source code with version b88f01142fea6495c2deb38e4d77afd41bd9088c
76
+ remote: ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
77
+ remote: !
78
+ remote: ! If you are developing on a branch and deploying via git you must run
79
+ remote: !
80
+ remote: ! git push heroku <branchname>:main
81
+ remote: !
82
+ remote: ! This article goes into details on the behavior:
83
+ remote: ! https://devcenter.heroku.com/articles/duplicate-build-version
84
+ remote:
85
+ remote: Verifying deploy...
86
+ remote:
87
+ remote: ! Push rejected to prj-portfolio-manager.
88
+ remote:
89
+ To https://git.heroku.com/prj-portfolio-manager.git
90
+ ! [remote rejected] main -> main (pre-receive hook declined)
91
+ error: failed to push some refs to 'https://git.heroku.com/prj-portfolio-manager.git'
92
+ ```
93
+
94
+ package-lock.jsonにより制御されていると判断し、ローカルのmainブランチで同ファイルを仮実装でリネームしたあと下記を実行したところ、エラー内容が変わっているのを確認しています。
95
+ ```
96
+ git push heroku main:main -f
97
+ ```
98
+
99
+ ```
100
+ Enumerating objects: 428, done.
101
+ Counting objects: 100% (428/428), done.
102
+ Delta compression using up to 8 threads
103
+ Compressing objects: 100% (392/392), done.
104
+ Writing objects: 100% (428/428), 323.33 KiB | 4.43 MiB/s, done.
105
+ Total 428 (delta 255), reused 0 (delta 0), pack-reused 0
106
+ remote: Compressing source files... done.
107
+ remote: Building source:
108
+ remote:
109
+ remote: -----> Building on the Heroku-20 stack
110
+ remote: -----> Using buildpacks:
111
+ remote: 1. heroku/nodejs
112
+ remote: 2. https://github.com/heroku/heroku-buildpack-static
113
+ remote: -----> Node.js app detected
114
+ remote:
115
+ remote: -----> Creating runtime environment
116
+ remote:
117
+ remote: NPM_CONFIG_LOGLEVEL=error
118
+ remote: USE_YARN_CACHE=true
119
+ remote: NODE_VERBOSE=false
120
+ remote: NODE_ENV=production
121
+ remote: NODE_MODULES_CACHE=true
122
+ remote:
123
+ remote: -----> Installing binaries
124
+ remote: engines.node (package.json): unspecified
125
+ remote: engines.npm (package.json): unspecified (use default)
126
+ remote: engines.yarn (package.json): unspecified (use default)
127
+ remote:
128
+ remote: Resolving node version 16.x...
129
+ remote: Downloading and installing node 16.15.0...
130
+ remote: Using default npm version: 8.5.5
131
+ remote: Resolving yarn version 1.22.x...
132
+ remote: Downloading and installing yarn (1.22.18)
133
+ remote: Installed yarn 1.22.18
134
+ remote:
135
+ remote: -----> Installing dependencies
136
+ remote: Installing node modules (yarn.lock)
137
+ remote: yarn install v1.22.18
138
+ remote: [1/4] Resolving packages...
139
+ remote: error Your lockfile needs to be updated, but yarn was run with `--frozen-lockfile`.
140
+ remote: info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
141
+ remote:
142
+ remote: -----> Build failed
143
+ remote:
144
+ remote: ! Outdated Yarn lockfile
145
+ remote:
146
+ remote: Your application contains a Yarn lockfile (yarn.lock) which does not
147
+ remote: match the dependencies in package.json. This can happen if you use npm
148
+ remote: to install or update a dependency instead of Yarn.
149
+ remote:
150
+ remote: Please run the following command in your application directory and check
151
+ remote: in the new yarn.lock file:
152
+ remote:
153
+ remote: $ yarn install
154
+ remote: $ git add yarn.lock
155
+ remote: $ git commit -m "Updated Yarn lockfile"
156
+ remote: $ git push heroku main
157
+ remote:
158
+ remote: https://help.heroku.com/TXYS53YJ
159
+ remote:
160
+ remote: ! Push rejected, failed to compile Node.js app.
161
+ remote:
162
+ remote: ! Push failed
163
+ remote: Verifying deploy...
164
+ remote:
165
+ remote: ! Push rejected to prj-portfolio-manager.
166
+ remote:
167
+ To https://git.heroku.com/prj-portfolio-manager.git
168
+ ! [remote rejected] main -> main (pre-receive hook declined)
169
+ error: failed to push some refs to 'https://git.heroku.com/prj-portfolio-manager.git'
170
+ ```
171
+
172
+ プロジェクト自体は一般的なVueCLIを使って実装したもので、パッケージ管理もnpmを使っています。
173
+ 新しいエラーでyarn関連の記載があるのですが、yarnは本プロジェクトでは使っていないので違和感がある状態です。
174
+
175
+