我一直在使用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
清理命令,但没有运气。
有趣的是,我仍然可以运行服务器,它唯一抱怨的控制台。
这是一个老问题,已经解决了,所以我写下了我最后所做的事情:
简单地删除node_modules
通常可以解决问题。如果你使用的是弹簧,它也可以搞砸了,所以考虑运行DISABLE_SPRING=1 rails s
来看看是否有帮助
尝试运行spring stop
重启spring。
这解决了我的问题,这意味着我不需要使用spring disable标志不断地为命令添加前缀。
上面的命令停止弹簧:检查它是否自动重启,运行spring status
。
感谢this comment on GitHub的解决方案!
试试这个:NODE_ENV=development yarn install