纱线安装说是最新的,但无法启动rails控制台

问题描述 投票:7回答:2

我一直在使用Webpack,Vue.js和Rails开发一个应用程序。两个月没有问题,但当我尝试启动rails console rails c时无处不在,yarn抱怨包裹过时了:

error An unexpected error occurred: "Unknown language key integrityNodeDoesntMatch".
info If you think this is a bug, please open a bug report with the information provided in "/Users/maksimfedotov/vras/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/check for documentation about this command.


========================================
  Your Yarn packages are out of date!
  Please run `yarn install` to update.
========================================

然而,当我运行yarn install

yarn install v1.3.2
[1/4] 🔍  Resolving packages...
success Already up-to-date.
✨  Done in 0.71s.

我一直在寻找纱线和webpacker文档,尝试了各种yarn清理命令,但没有运气。

有趣的是,我仍然可以运行服务器,它唯一抱怨的控制台。

ruby-on-rails webpack ruby-on-rails-5 yarnpkg
2个回答
5
投票

这是一个老问题,已经解决了,所以我写下了我最后所做的事情:

简单地删除node_modules通常可以解决问题。如果你使用的是弹簧,它也可以搞砸了,所以考虑运行DISABLE_SPRING=1 rails s来看看是否有帮助


1
投票

尝试运行spring stop重启spring。

这解决了我的问题,这意味着我不需要使用spring disable标志不断地为命令添加前缀。

上面的命令停止弹簧:检查它是否自动重启,运行spring status

感谢this comment on GitHub的解决方案!


-1
投票

试试这个:NODE_ENV=development yarn install

© www.soinside.com 2019 - 2024. All rights reserved.