summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorOlaf Mandel <o.mandel@menlosystems.com>2018-10-19 15:22:14 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-10-20 22:40:16 +0100
commit2713d9bcc39c712ef34003ce8424416441be558e (patch)
treee549062d03634808dcecee91a0192fe8b672304f /meta/classes
parent32914a1780f89e4f2f9a7d1280b5c9cdf31c57ef (diff)
downloadpoky-2713d9bcc39c712ef34003ce8424416441be558e.tar.gz
npm: change install directory to upstream default
The node binary searches for packages in a number of locations, the last of which is $PREFIX/lib/node (here: /usr/lib/node) from the list of GLOBAL_FOLDERS [1]. Change the installation directory for all packages depending on npm.bbclass to that location. This removes the need to define the NODE_PATH variable to the non-standard /usr/lib/node_modules value. While the Tips for Package Managers [2] discusses installing packages to /usr/lib/node_modules/<name>/<version>, this has several drawbacks: * it does not work for the REPL as mentioned in the documentation * it also does not work for any code _not_ installed as a global package under /usr/lib/node_modules (e.g. /usr/share/foo.js will not find any packages below /usr/lib) * using the non-default location and then having to set NODE_PATH barely saves any time: there are only two file-system lookups (to the legacy $HOME/.node_modules and $HOME/.node_libraries) directories before the library would be found And the suggestion was made in the context of deduping the node_modules tree by installing all packages in a flat hierarchy and using symlinks to the correct version of each dependency. This is not what OpenEmbedded does, so none of those benefits (deduping, cleaner packages) are being had by shifting the installation directory to /usr/lib/node_modules. [1]: https://nodejs.org/api/modules.html#modules_loading_from_the_global_folders [2]: https://nodejs.org/api/modules.html#modules_addenda_package_manager_tips (From OE-Core rev: 2036137151929b541293154ff529475071cd92b0) Signed-off-by: Olaf Mandel <o.mandel@menlosystems.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/npm.bbclass2
1 files changed, 1 insertions, 1 deletions
diff --git a/meta/classes/npm.bbclass b/meta/classes/npm.bbclass
index c351ff0866..d5ff0c6d57 100644
--- a/meta/classes/npm.bbclass
+++ b/meta/classes/npm.bbclass
@@ -10,7 +10,7 @@ def node_pkgname(d):
10 10
11NPMPN ?= "${@node_pkgname(d)}" 11NPMPN ?= "${@node_pkgname(d)}"
12 12
13NPM_INSTALLDIR = "${D}${libdir}/node_modules/${NPMPN}" 13NPM_INSTALLDIR = "${D}${libdir}/node/${NPMPN}"
14 14
15# function maps arch names to npm arch names 15# function maps arch names to npm arch names
16def npm_oe_arch_map(target_arch, d): 16def npm_oe_arch_map(target_arch, d):