【问题标题】:Installing Tailwind to Ruby on Rails 6 | The engine "node" is incompatible with this module将 Tailwind 安装到 Ruby on Rails 6 |引擎“节点”与此模块不兼容
【发布时间】:2021-07-20 21:11:25
【问题描述】:

在安装 Tailwind-CSS 时,我运行了这个命令

yarn add tailwindcss@npm:@tailwindcss/postcss7-compat postcss@^7 autoprefixer@^9

我收到此错误消息,告诉我将节点更新到兼容版本。

**error** tailwindcss@2.1.2: The engine "node" is incompatible with this module. Expected version ">=12.13.0". Got "10.24.1"

那么如何正确更新节点呢? 我正在使用 Ruby on Rails 6

更新

当我更新节点时,我遇到了一个后续问题。这是我跑来更新节点的

nvm install 12.22.1

现在当我尝试安装 Tailwind-CSS 时,我收到一条不同的错误消息。

Command 'yarn' not found

然后我运行 nvm use 10.24.1 并回到第一方。

【问题讨论】:

  • Ruby on rails 与顺风无关。关于节点版本

标签: ruby-on-rails yarnpkg tailwind-css


【解决方案1】:

当你通过 yarn 安装时,追加

--ignore-engines 

所以完整的安装命令是

yarn add tailwindcss@npm:@tailwindcss/postcss7-compat postcss@^7 autoprefixer@^9 --ignore-engines

我不知道为什么会这样,但确实如此

【讨论】:

  • 它之所以有效,是因为您忽略了引擎验证,这就是抱怨的原因。当您移动到不同版本的 Node 时找不到 Yarn,因为您没有为该版本的 Node 安装它
猜你喜欢
  • 2018-04-10
  • 2019-10-30
  • 2021-03-22
  • 2020-01-03
  • 2020-02-02
  • 2021-11-26
  • 1970-01-01
  • 2021-01-29
相关资源
最近更新 更多