【问题标题】:Yarn packages won't update for dependency issue纱线包不会因依赖问题而更新
【发布时间】:2021-04-10 12:35:16
【问题描述】:

在开发服务器上,对于几乎没有部署的应用程序,rails 命令将不会执行,因为缺少完整性文件。

error Couldn't find an integrity file
error Found 1 errors.


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

两者

yarn install --check-files
yarn install

导致同样的错误

compression-webpack-plugin@4.0.1: The engine "node" is incompatible with this module. Expected version ">= 10.13.0". Got "8.17.0"
Found incompatible module
 Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

遗憾的是,“访问”提示没有用,因为它不处理节点引擎。

几乎没有部署,还没有 node-modules 目录,这是预期的。然而,在开发机器上有目录,并且在预编译资产时没有任何问题。
服务器上下文:

node -v
> v8.17.0

这种情况如何解除?

【问题讨论】:

  • 你用的是什么操作系统?

标签: ruby-on-rails yarnpkg


【解决方案1】:

您需要将节点更新到高于>= 10.13.0 的版本,然后重新安装yarn 并重新运行检查:

如果您使用的是 Mac OS:

brew install node@14 && brew link --force node@14
brew install yarn

if you're on Linux:

cd ~
curl -sL https://deb.nodesource.com/setup_14.x -o nodesource_setup.sh
sudo bash nodesource_setup.sh
sudo apt install nodejs

然后检查你是否有兼容的版本

node -v
=> v14.2.0
``

if so re-run any of your commands:

```bash
yarn install --check-files
yarn install

【讨论】:

  • Rails 处理 gems 的版本,但不处理节点的版本,即使您配置了 yarn,如果您的节点库已过时,它仍然会失败,因为它是一个外部依赖项 - 可能在目标操作系统中它缺少依赖项我通常会在失败时关注日志,看看缺少什么,祝你好运!
猜你喜欢
  • 2021-09-08
  • 2019-02-26
  • 2019-12-29
  • 1970-01-01
  • 1970-01-01
  • 2020-03-11
  • 2016-01-06
  • 2017-01-28
  • 1970-01-01
相关资源
最近更新 更多