]> code.ossystems Code Review - openembedded-core.git/commit
npm: fix node and npm default directory conflict
authorJean-Marie LEMETAYER <jean-marie.lemetayer@savoirfairelinux.com>
Fri, 17 May 2019 15:14:09 +0000 (17:14 +0200)
committerArmin Kuster <akuster808@gmail.com>
Sun, 2 Jun 2019 17:25:22 +0000 (10:25 -0700)
commit67846b3b2d2d45401d500bff5cf3d4d71c003f7a
tree24bff39be77067fbfc644198fba3c4d653c3b204
parent86c9f25d4535663606326e53c33a8927f79e8f52
npm: fix node and npm default directory conflict

Fixes [YOCTO #13349]

When dealing with node modules which have declared "bin" files [1], npm
will create a link in '/usr/bin' with a relative link to
'../lib/node_modules/<module bin file>'.

The commits e9270af4296ce2af292059617a717e42fc17425c and
2713d9bcc39c712ef34003ce8424416441be558e explicitely use
'/usr/lib/node/' as install directory, but does not care about the "bin"
symbolic linked files.

In order to keep valid links, and to keep it as simple as possible, the
path '/usr/lib/node_modules/' is used as install directory for npm. And
a symbolic link is created to have a valid '/usr/lib/node/' path, needed
for node.

[1]: https://docs.npmjs.com/files/package.json#bin

Signed-off-by: Jean-Marie LEMETAYER <jean-marie.lemetayer@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
meta/classes/npm.bbclass