首页 > 解决方案 > 错误运行 rails -server,接收错误:纱线:错误:没有这样的选项:--integrity

问题描述

我在 Rails 6.0.3.4 和 Ruby 2.7.1 中工作,当我运行时rails -s,我在终端中收到以下错误:

Usage: yarn [options]

yarn: error: no such option: --integrity


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


To disable this check, please change `check_yarn_integrity`
to `false` in your webpacker config file (config/webpacker.yml).

当我运行时yarn install --check-files,我收到以下错误:

yarn: error: no such option: --check-files 

我确实在 webpacker.yml 中将 check_yarn_integrity 设置为 false。

标签: ruby-on-railsrubyyarnpkg

解决方案


尝试使用npm install --global yarn


推荐阅读