classes/npm: use npm install to do installation

Using "npm install" instead of "cp -a" is the more correct thing to be
doing here, and ensures that symlinks for executable scripts are put
into ${prefix}/bin. (I'd prefer ${bindir}, but npm does not allow
specifying paths at that level - only a prefix.)

Fixes [YOCTO #10460].

(From OE-Core rev: 90cb980a1c49de99a0aec00c0cd5fc1e165490a7)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Paul Eggleton 2016-10-31 17:02:23 +13:00 committed by Richard Purdie
parent 6879d524c1
commit ebe531b38b
1 changed files with 5 additions and 1 deletions

View File

@ -33,7 +33,11 @@ npm_do_compile() {
npm_do_install() {
mkdir -p ${NPM_INSTALLDIR}/
cp -a ${S}/* ${NPM_INSTALLDIR}/ --no-preserve=ownership
npm install --prefix ${D}${prefix} -g --arch=${NPM_ARCH} --target_arch=${NPM_ARCH} --production --no-registry
if [ -d ${D}${prefix}/etc ] ; then
# This will be empty
rmdir ${D}${prefix}/etc
fi
}
python populate_packages_prepend () {