<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/poky.git/meta/classes/npm.bbclass, branch master-next2</title>
<subtitle>Mirror of git.yoctoproject.org/poky</subtitle>
<id>https://git.enea.com/cgit/linux/poky.git/atom?h=master-next2</id>
<link rel='self' href='https://git.enea.com/cgit/linux/poky.git/atom?h=master-next2'/>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/'/>
<updated>2019-05-21T11:56:33+00:00</updated>
<entry>
<title>npm: remove some temporary build files</title>
<updated>2019-05-21T11:56:33+00:00</updated>
<author>
<name>Jean-Marie LEMETAYER</name>
<email>jean-marie.lemetayer@savoirfairelinux.com</email>
</author>
<published>2019-05-17T15:14:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=e90cd2ed61b93ee7e290e7e592f1f0242ab5c281'/>
<id>urn:sha1:e90cd2ed61b93ee7e290e7e592f1f0242ab5c281</id>
<content type='text'>
Fixes [YOCTO #11028]

When dealing with node modules which use "node-gyp" [1] to build native
addons to node. Some temporary build files stay in the image: object
files, static library files, dependency files, ...

This commit does not keep only the required files, but remove the files
which can leads to QA issues (staticdev with static library files).

[1]: https://github.com/nodejs/node-gyp

(From OE-Core rev: bac9075f51f6acba2fcfbe9f79f97f5171186d9c)

Signed-off-by: Jean-Marie LEMETAYER &lt;jean-marie.lemetayer@savoirfairelinux.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>npm: fix node and npm default directory conflict</title>
<updated>2019-05-21T11:56:33+00:00</updated>
<author>
<name>Jean-Marie LEMETAYER</name>
<email>jean-marie.lemetayer@savoirfairelinux.com</email>
</author>
<published>2019-05-17T15:14:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=a34d0d539e5fdf341541fb628652d22289e80512'/>
<id>urn:sha1:a34d0d539e5fdf341541fb628652d22289e80512</id>
<content type='text'>
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/&lt;module bin file&gt;'.

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

(From OE-Core rev: 2d72007deea7ed529f82b8a6e67e2715dd0a0dca)

Signed-off-by: Jean-Marie LEMETAYER &lt;jean-marie.lemetayer@savoirfairelinux.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>npm: get npm package name from npm pack</title>
<updated>2019-05-21T11:56:33+00:00</updated>
<author>
<name>Jean-Marie LEMETAYER</name>
<email>jean-marie.lemetayer@savoirfairelinux.com</email>
</author>
<published>2019-05-17T15:14:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=eecba41822e86b69ebdb9cbc8fbfd512ad9a47d7'/>
<id>urn:sha1:eecba41822e86b69ebdb9cbc8fbfd512ad9a47d7</id>
<content type='text'>
Fixes [YOCTO #12534]

When using npm packages with exotic names, like "JSONSelect" (with
uppercase) or "@angular/cli" (with at sign and slash), there are three
different names:
  - the recipe name ("jsonselect" or "angular-cli")
  - the npm module name ("JSONSelect" or "@angular/cli")
  - the npm pack name ("JSONSelect" or "angular-cli")

The commit fa9c077068a2acea04389fa2b44eb2e93548fce2 allow to have
different recipe name and npm module name by setting the NPMPN variable.

This commit allows to have yet another npm pack name. The pack filename
is now dynamically retrieved from the 'npm pack' command.

(From OE-Core rev: b6ffa59d03fbf53d1681fce5f8c3c1f163cf9923)

Signed-off-by: Jean-Marie LEMETAYER &lt;jean-marie.lemetayer@savoirfairelinux.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>npm.bbclass: allow overriding NPM_INSTALL_DEV</title>
<updated>2018-10-25T13:53:44+00:00</updated>
<author>
<name>Jef Driesen</name>
<email>jef.driesen@niko.eu</email>
</author>
<published>2018-10-23T11:43:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=3a184fdfa2c0766e8873ce9a7e65ad70c40c8efd'/>
<id>urn:sha1:3a184fdfa2c0766e8873ce9a7e65ad70c40c8efd</id>
<content type='text'>
Commit b1f10b18eaf6c8009e86863ca4a26f429de97082 added the NPM_INSTALL_DEV
variable. But due to the use of simple assignment, a recipe can't override its
value.

(From OE-Core rev: b53d5094d5e05f9c1955c8565d777ad74f668f7e)

Signed-off-by: Jef Driesen &lt;jef.driesen@niko.eu&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>npm: change install directory to upstream default</title>
<updated>2018-10-25T13:53:44+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2018-10-22T22:43:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=e9270af4296ce2af292059617a717e42fc17425c'/>
<id>urn:sha1:e9270af4296ce2af292059617a717e42fc17425c</id>
<content type='text'>
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]. So 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/&lt;name&gt;/&lt;version&gt;, 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.

The choice of a "proper" installation path is not helped by npm
installing to /usr/lib/node_modules if asked to install globally. Still,
using the location expected by nodejs (/usr/lib/node) seems the right
choice.

[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: c73bc49038effd64f2c2542c1f4da8b6a4168477)

Signed-off-by: Olaf Mandel &lt;o.mandel@menlosystems.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>npm: change install directory to upstream default</title>
<updated>2018-10-20T21:40:16+00:00</updated>
<author>
<name>Olaf Mandel</name>
<email>o.mandel@menlosystems.com</email>
</author>
<published>2018-10-19T15:22:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=2713d9bcc39c712ef34003ce8424416441be558e'/>
<id>urn:sha1:2713d9bcc39c712ef34003ce8424416441be558e</id>
<content type='text'>
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/&lt;name&gt;/&lt;version&gt;, 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 &lt;o.mandel@menlosystems.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>npm.bbclass: Node module name and recipe name can be different</title>
<updated>2018-02-06T11:06:27+00:00</updated>
<author>
<name>Böszörményi Zoltán</name>
<email>zboszor@pr.hu</email>
</author>
<published>2018-02-01T13:08:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=fa9c077068a2acea04389fa2b44eb2e93548fce2'/>
<id>urn:sha1:fa9c077068a2acea04389fa2b44eb2e93548fce2</id>
<content type='text'>
Some NPM modules have the same name as their low level dependencies.
To prevent recipe naming conflicts, allow node module recipe names
to start with the "node-" prefix.

(From OE-Core rev: 6b417c7c3a38463c64756beae9817fa2a80fd09e)

Signed-off-by: Zoltán Böszörményi &lt;zboszor@pr.hu&gt;
Signed-off-by: Ross Burton &lt;ross.burton@intel.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>npm.bbclass: Fix building node modules with npm@5</title>
<updated>2018-02-06T11:06:27+00:00</updated>
<author>
<name>Böszörményi Zoltán</name>
<email>zboszor@pr.hu</email>
</author>
<published>2018-02-01T13:08:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=d38e1e2c2ea4646b34ea6282d3d7620df5b0374b'/>
<id>urn:sha1:d38e1e2c2ea4646b34ea6282d3d7620df5b0374b</id>
<content type='text'>
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 &lt;zboszor@pr.hu&gt;
Signed-off-by: Ross Burton &lt;ross.burton@intel.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>classes/npm: allow installation of devDependencies</title>
<updated>2017-03-22T11:35:20+00:00</updated>
<author>
<name>Anders Darander</name>
<email>anders@chargestorm.se</email>
</author>
<published>2017-03-13T10:01:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=b1f10b18eaf6c8009e86863ca4a26f429de97082'/>
<id>urn:sha1:b1f10b18eaf6c8009e86863ca4a26f429de97082</id>
<content type='text'>
Often, eg when using angular2, there's a need to install also
the devDependencies.

The default is to keep the old behaviour, to not install
devDependencies.

(From OE-Core rev: 9377d16751aeff0a913e754d711bca6e4e4d9df1)

Signed-off-by: Anders Darander &lt;anders@chargestorm.se&gt;
Signed-off-by: Ross Burton &lt;ross.burton@intel.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>classes/npm: set HOME during do_install</title>
<updated>2017-02-07T14:50:09+00:00</updated>
<author>
<name>Paul Eggleton</name>
<email>paul.eggleton@linux.intel.com</email>
</author>
<published>2017-02-06T20:45:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=21ace8b6202e906689619ebdb41e745a6c12975b'/>
<id>urn:sha1:21ace8b6202e906689619ebdb41e745a6c12975b</id>
<content type='text'>
In do_compile we set HOME so that ~/.npm* only get created in the work
directory; we need to do the same in do_install as well or they'll go
into the user's home directory which we do not want.

(From OE-Core rev: a667cb9ed2dceb804b85d1a024e2619bc34d2681)

Signed-off-by: Paul Eggleton &lt;paul.eggleton@linux.intel.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
</feed>
