summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorBöszörményi Zoltán <zboszor@pr.hu>2018-02-01 14:08:30 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-02-06 11:06:27 +0000
commitd38e1e2c2ea4646b34ea6282d3d7620df5b0374b (patch)
tree714943b0d1d96589b3fc9db925f84a7ea1c3b3c9 /meta
parentbb40162b2b8625eac9cb95f4c0c8716d830af2e4 (diff)
downloadpoky-d38e1e2c2ea4646b34ea6282d3d7620df5b0374b.tar.gz
npm.bbclass: Fix building node modules with npm@5
npm cache clear throws an error with npm@5 and suggests to use npm cache verify instead. But our cache is actually empty, so use npm cache clear --force. npm install in the source directory creates symlinks with npm@5. Use a combination of npm pack and npm install module-version.tgz that works the same way with older and new npm versions and is guaranteed to create actual copies instead of directory symlinks. This change allows using nodejs 8.x LTS, tested with 8.9.4. (From OE-Core rev: 2d7d2a460842c8747df17990970f22f4a11f36f6) Signed-off-by: Zoltán Böszörményi <zboszor@pr.hu> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/npm.bbclass5
1 files changed, 3 insertions, 2 deletions
diff --git a/meta/classes/npm.bbclass b/meta/classes/npm.bbclass
index a69bedbb28..898a54eb50 100644
--- a/meta/classes/npm.bbclass
+++ b/meta/classes/npm.bbclass
@@ -31,7 +31,7 @@ npm_do_compile() {
31 fi 31 fi
32 npm set cache ${WORKDIR}/npm_cache 32 npm set cache ${WORKDIR}/npm_cache
33 # clear cache before every build 33 # clear cache before every build
34 npm cache clear 34 npm cache clear --force
35 # Install pkg into ${S} without going to the registry 35 # Install pkg into ${S} without going to the registry
36 if [ "${NPM_INSTALL_DEV}" = "1" ]; then 36 if [ "${NPM_INSTALL_DEV}" = "1" ]; then
37 npm --arch=${NPM_ARCH} --target_arch=${NPM_ARCH} --no-registry install 37 npm --arch=${NPM_ARCH} --target_arch=${NPM_ARCH} --no-registry install
@@ -45,7 +45,8 @@ npm_do_install() {
45 # be created in this directory 45 # be created in this directory
46 export HOME=${WORKDIR} 46 export HOME=${WORKDIR}
47 mkdir -p ${NPM_INSTALLDIR}/ 47 mkdir -p ${NPM_INSTALLDIR}/
48 npm install --prefix ${D}${prefix} -g --arch=${NPM_ARCH} --target_arch=${NPM_ARCH} --production --no-registry 48 npm pack .
49 npm install --prefix ${D}${prefix} -g --arch=${NPM_ARCH} --target_arch=${NPM_ARCH} --production --no-registry ${PN}-${PV}.tgz
49 if [ -d ${D}${prefix}/etc ] ; then 50 if [ -d ${D}${prefix}/etc ] ; then
50 # This will be empty 51 # This will be empty
51 rmdir ${D}${prefix}/etc 52 rmdir ${D}${prefix}/etc