【发布时间】:2019-04-05 15:01:23
【问题描述】:
我有一个配方,它安装了一些适用于旧版本 Yocto 的 NPM 包。
升级到 sumo 后,配方失败并出现以下错误: installnpmpackages/0.0.1-r0/temp/run.do_compile.7272:npm:未找到 |警告:从 shell 命令退出代码 127。
我尝试使用开发者 shell,NPM 在这种情况下确实有效。
配方中的 do_compile:
do_compile() {
# Create a working directory
mkdir -p ${WORKDIR}/scratch
# changing the home directory to the working directory, the .npmrc will be created in this directory
export HOME=${WORKDIR}/scratch
# configure cache to be in working directory
npm set cache ${WORKDIR}/scratch/npm_cache
# clear local cache prior to each compile
npm cache clear
# compile and install node modules in source directory
cd ${WORKDIR}/scratch
npm --arch=${TARGET_ARCH} --verbose install node-gyp
npm --arch=${TARGET_ARCH} --verbose install connect
npm --arch=${TARGET_ARCH} --verbose install socket.io
#npm --arch=${TARGET_ARCH} --verbose install sqlite3
#npm --arch=${TARGET_ARCH} --verbose install serialport
npm --arch=${TARGET_ARCH} --verbose install express
npm --arch=${TARGET_ARCH} --verbose install csv
npm --arch=${TARGET_ARCH} --verbose install md5
# clear local cache before we package. No need to copy over all this cache stuff; just need the modules.
npm cache clear
}
注意 sqlite3 和 serialport 被注释掉,因为它们在以前的版本中不起作用。
为了让 NPM 在配方中发挥作用,需要对 sumo(与 morty 相比)进行哪些更改?
提前谢谢你!
【问题讨论】: