【发布时间】:2018-04-24 14:17:17
【问题描述】:
我正在尝试使用 Heroku CLI 在 Heroku 上部署一个 React Web 应用程序。但是,当我跑步时,
git push heroku 大师
从我的项目文件夹中它会引发错误:
Counting objects: 213, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (212/212), done.
Writing objects: 100% (213/213), 515.89 KiB | 0 bytes/s, done.
Total 213 (delta 40), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Node.js app detected
remote:
remote: -----> Build failed
remote: ! Two different lockfiles found: package-lock.json and
yarn.lock
remote:
remote: Both npm and yarn have created lockfiles for this
application,
remote: but only one can be used to install dependencies.
Installing
remote: dependencies using the wrong package manager can
result in missing
remote: packages or subtle bugs in production.
remote:
remote: - To use npm to install your application's
dependencies please delete
remote: the yarn.lock file.
remote:
remote: $ git rm yarn.lock
remote:
remote: - To use yarn to install your application's
dependences please delete
remote: the package-lock.json file.
remote:
remote: $ git rm package-lock.json
remote:
remote: https://kb.heroku.com/why-is-my-node-js-build-
failing-because-of-conflicting-lock-files
remote:
remote: ! Push rejected, failed to compile Node.js app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to MyAPP.
remote:
To https://git.heroku.com/MyAPP.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to
https://git.heroku.com/MyAPP.git'
自从我使用 npm 以来,我做了 rm 并删除了 yarn lock 文件。仍然出现相同的错误。现在,当我实际执行rm yarn.lock 时,我在终端中找不到任何条目。我想知道为什么 Heroku CLI 坚持我的目录中仍然有纱线锁定文件。
【问题讨论】:
标签: node.js heroku server package-managers yarnpkg