有没有办法在 Debian 上安装“无头” npm?

有没有办法在 Debian 上安装“无头” npm?

尝试apt install npm在 docker debian-slim 映像上进行操作时,我得到了一个荒谬的依赖项列表:

root@77e0ec053780:/app# apt install npm
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  adwaita-icon-theme at-spi2-core binutils binutils-common binutils-x86-64-linux-gnu build-essential bzip2 ca-certificates cpp cpp-10 dbus
  dbus-user-session dconf-gsettings-backend dconf-service dirmngr dmsetup dpkg-dev fakeroot fontconfig fontconfig-config fonts-dejavu-core
  g++ g++-10 gcc gcc-10 git git-man glib-networking glib-networking-common glib-networking-services gnupg gnupg-l10n gnupg-utils gpg
  gpg-agent gpg-wks-client gpg-wks-server gpgconf gpgsm gsettings-desktop-schemas gtk-update-icon-cache gyp hicolor-icon-theme
  javascript-common less libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libapparmor1 libargon2-1 libasan6
  libassuan0 libatk-bridge2.0-0 libatk1.0-0 libatk1.0-data libatomic1 libatspi2.0-0 libauthen-sasl-perl libavahi-client3
  libavahi-common-data libavahi-common3 libbinutils libbrotli1 libbsd0 libc-ares2 libc-dev-bin libc-devtools libc6-dev libcairo-gobject2
  libcairo2 libcap2 libcbor0 libcc1-0 libclone-perl libcolord2 libcrypt-dev libcryptsetup12 libctf-nobfd0 libctf0 libcups2 libcurl3-gnutls
  libdata-dump-perl libdatrie1 libdbus-1-3 libdconf1 libdeflate0 libdevmapper1.02.1 libdpkg-perl libdrm-amdgpu1 libdrm-common
  libdrm-intel1 libdrm-nouveau2 libdrm-radeon1 libdrm2 libedit2 libelf1 libencode-locale-perl libepoxy0 liberror-perl libexpat1
  libfakeroot libfido2-1 libfile-basedir-perl libfile-desktopentry-perl libfile-fcntllock-perl libfile-listing-perl libfile-mimeinfo-perl
  libfont-afm-perl libfontconfig1 libfontenc1 libfreetype6 libfribidi0 libgcc-10-dev libgd3 libgdbm-compat4 libgdbm6 libgdk-pixbuf-2.0-0
  libgdk-pixbuf2.0-bin libgdk-pixbuf2.0-common libgl1 libgl1-mesa-dri libglapi-mesa libglib2.0-0 libglib2.0-data libglvnd0 libglx-mesa0
  libglx0 libgomp1 libgpm2 libgraphite2-3 libgtk-3-0 libgtk-3-bin libgtk-3-common libharfbuzz0b libhtml-form-perl libhtml-format-perl
  libhtml-parser-perl libhtml-tagset-perl libhtml-tree-perl libhttp-cookies-perl libhttp-daemon-perl libhttp-date-perl
  libhttp-message-perl libhttp-negotiate-perl libice6 libicu67 libio-html-perl libio-socket-ssl-perl libio-stringy-perl libip4tc2
  libipc-system-simple-perl libisl23 libitm1 libjbig0 libjpeg62-turbo libjs-highlight.js libjs-inherits libjs-is-typedarray libjs-psl
  libjs-typedarray-to-buffer libjson-c5 libjson-glib-1.0-0 libjson-glib-1.0-common libkmod2 libksba8 liblcms2-2 libldap-2.4-2
  libldap-common libllvm11 liblocale-gettext-perl liblsan0 liblua5.3-0 liblwp-mediatypes-perl liblwp-protocol-https-perl libmailtools-perl
  libmd0 libmpc3 libmpdec3 libmpfr6 libncursesw6 libnet-dbus-perl libnet-http-perl libnet-smtp-ssl-perl libnet-ssleay-perl libnghttp2-14
  libnode-dev libnode72 libnpth0 libnsl-dev libnss-systemd libpam-systemd libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0
  libpciaccess0 libperl5.32 libpixman-1-0 libpng16-16 libproxy1v5 libpsl5 libpython3-stdlib libpython3.9-minimal libpython3.9-stdlib
  libquadmath0 libreadline8 librest-0.7-0 librsvg2-2 librsvg2-common librtmp1 libsasl2-2 libsasl2-modules libsasl2-modules-db
  libsensors-config libsensors5 libsm6 libsoup-gnome2.4-1 libsoup2.4-1 libsqlite3-0 libssh2-1 libssl-dev libstdc++-10-dev
  libtext-iconv-perl libthai-data libthai0 libtie-ixhash-perl libtiff5 libtimedate-perl libtirpc-dev libtry-tiny-perl libtsan0 libubsan1
  liburi-perl libuv1 libuv1-dev libvte-2.91-0 libvte-2.91-common libvulkan1 libwayland-client0 libwayland-cursor0 libwayland-egl1 libwebp6
  libwww-perl libwww-robotrules-perl libx11-6 libx11-data libx11-protocol-perl libx11-xcb1 libxau6 libxaw7 libxcb-dri2-0 libxcb-dri3-0
  libxcb-glx0 libxcb-present0 libxcb-randr0 libxcb-render0 libxcb-shape0 libxcb-shm0 libxcb-sync1 libxcb-xfixes0 libxcb1 libxcomposite1
  libxcursor1 libxdamage1 libxdmcp6 libxext6 libxfixes3 libxft2 libxi6 libxinerama1 libxkbcommon0 libxkbfile1 libxml-parser-perl
  libxml-twig-perl libxml-xpathengine-perl libxml2 libxmu6 libxmuu1 libxpm4 libxrandr2 libxrender1 libxshmfence1 libxt6 libxtst6 libxv1
  libxxf86dga1 libxxf86vm1 libz3-4 linux-libc-dev make manpages manpages-dev media-types mesa-vulkan-drivers netbase node-abbrev
  node-agent-base node-ajv node-ansi node-ansi-regex node-ansi-styles node-ansistyles node-aproba node-archy node-are-we-there-yet
  node-asap node-asn1 node-assert-plus node-asynckit node-aws-sign2 node-aws4 node-balanced-match node-bcrypt-pbkdf node-brace-expansion
  node-builtins node-cacache node-caseless node-chalk node-chownr node-clone node-color-convert node-color-name node-colors node-columnify
  node-combined-stream node-concat-map node-console-control-strings node-copy-concurrently node-core-util-is node-dashdash node-debug
  node-defaults node-delayed-stream node-delegates node-depd node-ecc-jsbn node-encoding node-err-code node-escape-string-regexp
  node-extend node-extsprintf node-fast-deep-equal node-forever-agent node-form-data node-fs-write-stream-atomic node-fs.realpath
  node-function-bind node-gauge node-getpass node-glob node-graceful-fs node-gyp node-har-schema node-har-validator node-has-flag
  node-has-unicode node-hosted-git-info node-http-signature node-https-proxy-agent node-iconv-lite node-iferr node-imurmurhash
  node-indent-string node-inflight node-inherits node-ini node-ip node-ip-regex node-is-typedarray node-isarray node-isexe node-isstream
  node-jsbn node-json-parse-better-errors node-json-schema node-json-schema-traverse node-json-stable-stringify node-json-stringify-safe
  node-jsonify node-jsonparse node-jsonstream node-jsprim node-leven node-lockfile node-lru-cache node-mime node-mime-types node-minimatch
  node-mkdirp node-move-concurrently node-ms node-mute-stream node-nopt node-normalize-package-data node-npm-bundled node-npm-package-arg
  node-npmlog node-number-is-nan node-oauth-sign node-object-assign node-once node-opener node-osenv node-p-map node-path-is-absolute
  node-performance-now node-process-nextick-args node-promise-inflight node-promise-retry node-promzard node-psl node-puka node-punycode
  node-qs node-read node-read-package-json node-readable-stream node-request node-resolve node-resolve-from node-retry node-rimraf
  node-run-queue node-safe-buffer node-semver node-set-blocking node-signal-exit node-slash node-spdx-correct node-spdx-exceptions
  node-spdx-expression-parse node-spdx-license-ids node-sshpk node-ssri node-string-decoder node-string-width node-strip-ansi
  node-supports-color node-tar node-text-table node-through node-tough-cookie node-tunnel-agent node-tweetnacl node-typedarray-to-buffer
  node-unique-filename node-universalify node-uri-js node-util-deprecate node-uuid node-validate-npm-package-license
  node-validate-npm-package-name node-verror node-wcwidth.js node-which node-wide-align node-wrappy node-write-file-atomic node-yallist
  nodejs nodejs-doc openssh-client openssl patch perl perl-modules-5.32 perl-openssl-defaults pinentry-curses publicsuffix python3
  python3-minimal python3-pkg-resources python3.9 python3.9-minimal readline-common sensible-utils shared-mime-info systemd systemd-sysv
  systemd-timesyncd termit ucf x11-common x11-utils x11-xserver-utils xauth xdg-user-dirs xdg-utils xkb-data xz-utils
Suggested packages:
  binutils-doc bzip2-doc cpp-doc gcc-10-locales pinentry-gnome3 tor debian-keyring g++-multilib g++-10-multilib gcc-10-doc gcc-multilib
  autoconf automake libtool flex bison gdb gcc-doc gcc-10-multilib gettext-base git-daemon-run | git-daemon-sysvinit git-doc git-el
  git-email git-gui gitk gitweb git-cvs git-mediawiki git-svn parcimonie xloadimage scdaemon apache2 | lighttpd | httpd
  libdigest-hmac-perl libgssapi-perl glibc-doc colord cups-common bzr libgd-tools gdbm-l10n gpm gvfs liblcms2-utils libcrypt-ssleay-perl
  pciutils librsvg2-bin libsasl2-modules-gssapi-mit | libsasl2-modules-gssapi-heimdal libsasl2-modules-ldap libsasl2-modules-otp
  libsasl2-modules-sql lm-sensors libssl-doc libstdc++-10-doc libauthen-ntlm-perl libunicode-map8-perl libunicode-string-perl
  xml-twig-tools make-doc man-browser keychain libpam-ssh monkeysphere ssh-askpass ed diffutils-doc perl-doc libterm-readline-gnu-perl
  | libterm-readline-perl-perl libtap-harness-archive-perl pinentry-doc python3-doc python3-tk python3-venv python3-setuptools
  python3.9-venv python3.9-doc binfmt-support readline-doc systemd-container policykit-1 mesa-utils nickle cairo-5c xorg-docs-core
The following NEW packages will be installed:
  adwaita-icon-theme at-spi2-core binutils binutils-common binutils-x86-64-linux-gnu build-essential bzip2 ca-certificates cpp cpp-10 dbus
  dbus-user-session dconf-gsettings-backend dconf-service dirmngr dmsetup dpkg-dev fakeroot fontconfig fontconfig-config fonts-dejavu-core
  g++ g++-10 gcc gcc-10 git git-man glib-networking glib-networking-common glib-networking-services gnupg gnupg-l10n gnupg-utils gpg
  gpg-agent gpg-wks-client gpg-wks-server gpgconf gpgsm gsettings-desktop-schemas gtk-update-icon-cache gyp hicolor-icon-theme
  javascript-common less libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libapparmor1 libargon2-1 libasan6
  libassuan0 libatk-bridge2.0-0 libatk1.0-0 libatk1.0-data libatomic1 libatspi2.0-0 libauthen-sasl-perl libavahi-client3
  libavahi-common-data libavahi-common3 libbinutils libbrotli1 libbsd0 libc-ares2 libc-dev-bin libc-devtools libc6-dev libcairo-gobject2
  libcairo2 libcap2 libcbor0 libcc1-0 libclone-perl libcolord2 libcrypt-dev libcryptsetup12 libctf-nobfd0 libctf0 libcups2 libcurl3-gnutls
  libdata-dump-perl libdatrie1 libdbus-1-3 libdconf1 libdeflate0 libdevmapper1.02.1 libdpkg-perl libdrm-amdgpu1 libdrm-common
  libdrm-intel1 libdrm-nouveau2 libdrm-radeon1 libdrm2 libedit2 libelf1 libencode-locale-perl libepoxy0 liberror-perl libexpat1
  libfakeroot libfido2-1 libfile-basedir-perl libfile-desktopentry-perl libfile-fcntllock-perl libfile-listing-perl libfile-mimeinfo-perl
  libfont-afm-perl libfontconfig1 libfontenc1 libfreetype6 libfribidi0 libgcc-10-dev libgd3 libgdbm-compat4 libgdbm6 libgdk-pixbuf-2.0-0
  libgdk-pixbuf2.0-bin libgdk-pixbuf2.0-common libgl1 libgl1-mesa-dri libglapi-mesa libglib2.0-0 libglib2.0-data libglvnd0 libglx-mesa0
  libglx0 libgomp1 libgpm2 libgraphite2-3 libgtk-3-0 libgtk-3-bin libgtk-3-common libharfbuzz0b libhtml-form-perl libhtml-format-perl
  libhtml-parser-perl libhtml-tagset-perl libhtml-tree-perl libhttp-cookies-perl libhttp-daemon-perl libhttp-date-perl
  libhttp-message-perl libhttp-negotiate-perl libice6 libicu67 libio-html-perl libio-socket-ssl-perl libio-stringy-perl libip4tc2
  libipc-system-simple-perl libisl23 libitm1 libjbig0 libjpeg62-turbo libjs-highlight.js libjs-inherits libjs-is-typedarray libjs-psl
  libjs-typedarray-to-buffer libjson-c5 libjson-glib-1.0-0 libjson-glib-1.0-common libkmod2 libksba8 liblcms2-2 libldap-2.4-2
  libldap-common libllvm11 liblocale-gettext-perl liblsan0 liblua5.3-0 liblwp-mediatypes-perl liblwp-protocol-https-perl libmailtools-perl
  libmd0 libmpc3 libmpdec3 libmpfr6 libncursesw6 libnet-dbus-perl libnet-http-perl libnet-smtp-ssl-perl libnet-ssleay-perl libnghttp2-14
  libnode-dev libnode72 libnpth0 libnsl-dev libnss-systemd libpam-systemd libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0
  libpciaccess0 libperl5.32 libpixman-1-0 libpng16-16 libproxy1v5 libpsl5 libpython3-stdlib libpython3.9-minimal libpython3.9-stdlib
  libquadmath0 libreadline8 librest-0.7-0 librsvg2-2 librsvg2-common librtmp1 libsasl2-2 libsasl2-modules libsasl2-modules-db
  libsensors-config libsensors5 libsm6 libsoup-gnome2.4-1 libsoup2.4-1 libsqlite3-0 libssh2-1 libssl-dev libstdc++-10-dev
  libtext-iconv-perl libthai-data libthai0 libtie-ixhash-perl libtiff5 libtimedate-perl libtirpc-dev libtry-tiny-perl libtsan0 libubsan1
  liburi-perl libuv1 libuv1-dev libvte-2.91-0 libvte-2.91-common libvulkan1 libwayland-client0 libwayland-cursor0 libwayland-egl1 libwebp6
  libwww-perl libwww-robotrules-perl libx11-6 libx11-data libx11-protocol-perl libx11-xcb1 libxau6 libxaw7 libxcb-dri2-0 libxcb-dri3-0
  libxcb-glx0 libxcb-present0 libxcb-randr0 libxcb-render0 libxcb-shape0 libxcb-shm0 libxcb-sync1 libxcb-xfixes0 libxcb1 libxcomposite1
  libxcursor1 libxdamage1 libxdmcp6 libxext6 libxfixes3 libxft2 libxi6 libxinerama1 libxkbcommon0 libxkbfile1 libxml-parser-perl
  libxml-twig-perl libxml-xpathengine-perl libxml2 libxmu6 libxmuu1 libxpm4 libxrandr2 libxrender1 libxshmfence1 libxt6 libxtst6 libxv1
  libxxf86dga1 libxxf86vm1 libz3-4 linux-libc-dev make manpages manpages-dev media-types mesa-vulkan-drivers netbase node-abbrev
  node-agent-base node-ajv node-ansi node-ansi-regex node-ansi-styles node-ansistyles node-aproba node-archy node-are-we-there-yet
  node-asap node-asn1 node-assert-plus node-asynckit node-aws-sign2 node-aws4 node-balanced-match node-bcrypt-pbkdf node-brace-expansion
  node-builtins node-cacache node-caseless node-chalk node-chownr node-clone node-color-convert node-color-name node-colors node-columnify
  node-combined-stream node-concat-map node-console-control-strings node-copy-concurrently node-core-util-is node-dashdash node-debug
  node-defaults node-delayed-stream node-delegates node-depd node-ecc-jsbn node-encoding node-err-code node-escape-string-regexp
  node-extend node-extsprintf node-fast-deep-equal node-forever-agent node-form-data node-fs-write-stream-atomic node-fs.realpath
  node-function-bind node-gauge node-getpass node-glob node-graceful-fs node-gyp node-har-schema node-har-validator node-has-flag
  node-has-unicode node-hosted-git-info node-http-signature node-https-proxy-agent node-iconv-lite node-iferr node-imurmurhash
  node-indent-string node-inflight node-inherits node-ini node-ip node-ip-regex node-is-typedarray node-isarray node-isexe node-isstream
  node-jsbn node-json-parse-better-errors node-json-schema node-json-schema-traverse node-json-stable-stringify node-json-stringify-safe
  node-jsonify node-jsonparse node-jsonstream node-jsprim node-leven node-lockfile node-lru-cache node-mime node-mime-types node-minimatch
  node-mkdirp node-move-concurrently node-ms node-mute-stream node-nopt node-normalize-package-data node-npm-bundled node-npm-package-arg
  node-npmlog node-number-is-nan node-oauth-sign node-object-assign node-once node-opener node-osenv node-p-map node-path-is-absolute
  node-performance-now node-process-nextick-args node-promise-inflight node-promise-retry node-promzard node-psl node-puka node-punycode
  node-qs node-read node-read-package-json node-readable-stream node-request node-resolve node-resolve-from node-retry node-rimraf
  node-run-queue node-safe-buffer node-semver node-set-blocking node-signal-exit node-slash node-spdx-correct node-spdx-exceptions
  node-spdx-expression-parse node-spdx-license-ids node-sshpk node-ssri node-string-decoder node-string-width node-strip-ansi
  node-supports-color node-tar node-text-table node-through node-tough-cookie node-tunnel-agent node-tweetnacl node-typedarray-to-buffer
  node-unique-filename node-universalify node-uri-js node-util-deprecate node-uuid node-validate-npm-package-license
  node-validate-npm-package-name node-verror node-wcwidth.js node-which node-wide-align node-wrappy node-write-file-atomic node-yallist
  nodejs nodejs-doc npm openssh-client openssl patch perl perl-modules-5.32 perl-openssl-defaults pinentry-curses publicsuffix python3
  python3-minimal python3-pkg-resources python3.9 python3.9-minimal readline-common sensible-utils shared-mime-info systemd systemd-sysv
  systemd-timesyncd termit ucf x11-common x11-utils x11-xserver-utils xauth xdg-user-dirs xdg-utils xkb-data xz-utils
0 upgraded, 490 newly installed, 0 to remove and 0 not upgraded.
Need to get 214 MB of archives.
After this operation, 822 MB of additional disk space will be used.

它将安装 X、systemd、字体等等。

我只想运行构建命令,例如 npx create 等。

有没有更明智的方法?

相关内容