Currently npm
and yarn
is included in bundle nodejs-basic
. This is good, but this may also bring some problems.
Some files included in nodejs-basic
might be modified when updating npm
or yarn
by executing sth. like npm i -g npm
. This can be confirmed by
- install
nodejs-basic
- then run
npm i -g npm
- then
swupd diagnose
.
Here is a part of the output:
Checking for missing files
-> Missing file: /usr/lib/node_modules/npm/node_modules/block-stream
-> Missing file: /usr/lib/node_modules/npm/node_modules/block-stream/LICENCE
-> Missing file: /usr/lib/node_modules/npm/node_modules/block-stream/LICENSE
-> Missing file: /usr/lib/node_modules/npm/node_modules/block-stream/README.md
...
This can be a trouble esp when nodejs-basic
needs to upgrade. Doing so may break npm’s versioning system, esp when nodejs-basic
is not shipping newest version of npm
.
Anyway, /usr/lib/node_modules
should always be managed by npm
solely. swupd
or nodejs-basic
should never touch it.