Symfony Encore安装安装返回错误在Ubuntu下的不兼容node.js上

发布于 2025-02-03 12:02:56 字数 927 浏览 4 评论 0 原文

在安装新的Symfony 5.4之后,

composer create-project symfony/website-skeleton myprojectname-sf5.4 ^5.4.9

我安装了 Encore ,如 https://symfony.com/doc/current/frontend/encore/installation.html 页面:

composer require symfony/webpack-encore-bundle

然后

yarn install

返回此错误:

error @symfony/[email protected]: The engine "node" is incompatible with this module. \
Expected version "^12.13.0 || >=14.0.0". Got "10.19.0"

After installed fresh symfony 5.4 with

composer create-project symfony/website-skeleton myprojectname-sf5.4 ^5.4.9

I installed encore as mentioned in https://symfony.com/doc/current/frontend/encore/installation.html page:

composer require symfony/webpack-encore-bundle

then

yarn install

which returns this error :

error @symfony/[email protected]: The engine "node" is incompatible with this module. \
Expected version "^12.13.0 || >=14.0.0". Got "10.19.0"

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

眉目亦如画i 2025-02-10 12:02:56

即使页面也提到:“首先确保安装node.js”,我认为我的实际节点还可以(以前的Symfony Projects可以正常工作)。

另一点是,即使我将ubuntu从仿生学升级到焦点,在默认的ubuntu存储库中安装了node.js,也是 debrecated - > 10.19.0

最后,我删除了旧的nodejs,然后使用 n ((或适用于法国用户,在Ubuntu帮助:

Even if https://symfony.com/doc/current/frontend/encore/installation.html page also mentioned : "First make sure you install Node.js", I thought my actual node was ok (previous symfony projects works fine).

The other point is, even if I upgrade my ubuntu from bionic to focal, installed node.js in default ubuntu repository is deprecated -> 10.19.0

Finally, I remove old nodejs, then installed with n (or for french users, in ubuntu help : https://doc.ubuntu-fr.org/nodejs#au_moyen_du_gestionnaire_de_versions_n )

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文