在部署中找不到websocket-driver

时间:2019-06-22 18:24:52

标签: ruby-on-rails node.js heroku

我正在尝试在Heroku上更新Rails 5.2.1应用程序,但出现此错误。

remote: -----> Installing dependencies
remote:        Installing node modules (yarn.lock)
remote:        yarn install v1.17.2
remote:        [1/4] Resolving packages...
remote:        [2/4] Fetching packages...
remote:        error An unexpected error occurred: "https://registry.yarnpkg.com/websocket-driver/-/websocket-driver-0.7.2.tgz: Request failed \"404 Not Found\"".
remote:        info If you think this is a bug, please open a bug report with the information provided in "/tmp/build_053b37334aad96876abbe953fb52fde5/yarn-error.log".
remote:        info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
remote:
remote: -----> Build failed
remote:
remote:        We're sorry this build is failing! You can troubleshoot common issues here:
remote:        https://devcenter.heroku.com/articles/troubleshooting-node-deploys
remote:
remote:        Some possible problems:
remote:
remote:        - Node version not specified in package.json
remote:          https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
remote:
remote:        Love,
remote:        Heroku
remote:
remote:  !     Push rejected, failed to compile Node.js app.
remote:
remote:  !     Push failed
remote: Verifying deploy...
remote:
remote: !   Push rejected to myapp-production.
remote:
To https://git.heroku.com/lapenderie-production.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/myapp-production.git'

这是我的package.json

{
  "name": "kamelot",
  "private": true,
  "dependencies": {
    "@rails/webpacker": "3.5",
    "babel-preset-react": "^6.24.1",
    "flatpickr": "^4.5.7",
    "highcharts": "^7.1.1",
    "prop-types": "^15.7.2",
    "react": "^16.8.6",
    "react-color": "^2.17.3",
    "react-dom": "^16.8.6",
    "react_ujs": "^2.5.0",
    "webpack-cli": "^3.3.4"
  },
  "devDependencies": {
    "webpack-dev-server": "2.11.2"
  }
}

我尝试添加节点版本,但这不能解决问题。

这曾经起作用。我该如何解决?

我找不到此文件"/tmp/build_545b56879454d397f9a53d8826eeeffb/yarn-error.log"

我做了以下

   cd tmp

build_

3 个答案:

答案 0 :(得分:6)

出于某种原因version 0.7.2 of websocket-driver is not published on NPM,尽管确实exist on GitHub

我建议您升级到0.7.3(或阅读本文时的最新版本)并重新部署:

yarn upgrade websocket-driver
git add yarn.lock
git commit -m 'Update dependencies'
git push heroku master

答案 1 :(得分:1)

对我来说最好的方法:

  • 删除package-lock.json
  • npm我

答案 2 :(得分:0)

删除package-lock.json,然后按Kurkov Igor的说法再试一次“ npm i”。

我刚才遇到了同样的错误。