I built nodejs v10.16.0 and attempted to build a container image with it. When
I try and run the container I get the following:
[neale@docker 10]$ docker run --rm -it clefos/node:10 bash
bash-4.2# id
uid=0(root) gid=0(root) groups=0(root)
bash-4.2# npm
fs.js:114
throw err;
^
Error: ENOENT: no such file or directory, open '/usr/lib/utils/unsupported.js'
at Object.openSync (fs.js:443:3)
at Object.readFileSync (fs.js:343:35)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:786:20)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at /usr/bin/npm:19:21
at Object.<anonymous> (/usr/bin/npm:152:3)
bash-4.2# exit
However, if I add the --privileged option to the run command it works:
[neale@docker 10]$ docker run --privileged --rm -it clefos/node:10 bash
bash-4.2# npm
Usage: npm <command>
where <command> is one of:
access, adduser, audit, bin, bugs, c, cache, ci, cit,
clean-install, clean-install-test, completion, config,
create, ddp, dedupe, deprecate, dist-tag, docs, doctor,
edit, explore, get, help, help-search, hook, i, init,
install, install-ci-test, install-test, it, link, list, ln,
login, logout, ls, org, outdated, owner, pack, ping, prefix,
profile, prune, publish, rb, rebuild, repo, restart, root,
run, run-script, s, se, search, set, shrinkwrap, star,
stars, start, stop, t, team, test, token, tst, un,
uninstall, unpublish, unstar, up, update, v, version, view,
whoami
npm <command> -h quick help on <command>
npm -l display full usage info
npm help <term> search for help on <term>
npm help npm involved overview
Specify configs in the ini-formatted file:
/root/.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config
[email protected] /usr/lib/node_modules/npm
I am trying to work out why? Any ideas? Note unsupported.js lives in
/usr/lib/node_modules/npm/lib/utils/unsupported.js.
Neale
----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO LINUX-390 or visit
http://www2.marist.edu/htbin/wlvindex?LINUX-390