在 Yocto 项目的 meta-nodejs 中指定 nodejs 的版本

Specify version of nodejs in meta-nodejs in a Yocto project

我第一次使用 Yocto 进行嵌入式系统的概念验证。我已经设置了 meta-nodejs 层并且可以构建一个 nodejs 版本:

bitbake nodejs 运行到完成:

NOTE: Tasks Summary: Attempted 707 tasks of which 700 didn't need to be rerun and all succeeded.

然而,默认情况下似乎 select nodejs v0.8 - 我如何看到我需要的 4.3.1 的食谱,但我在哪里指定版本?找不到这方面的文档!

我的 local.conf 显示:

IMAGE_INSTALL_append = " nodejs"

谢谢

您必须在您的配置文件之一中指定 PREFERRED_VERSION_nodejs = "4.3.1"(例如 local.conf)。

这是文档中的相应部分:

If there are multiple versions of recipes available, this variable determines which recipe should be given preference. You must always suffix the variable with the PN you want to select, and you should set the PV accordingly for precedence. You can use the "%" character as a wildcard to match any number of characters, which can be useful when specifying versions that contain long revision numbers that could potentially change. Here are two examples:

 PREFERRED_VERSION_python = "2.7.3"
 PREFERRED_VERSION_linux-yocto = "3.19%"

https://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#var-PREFERRED_VERSION