{"id":639,"date":"2021-04-30T13:30:42","date_gmt":"2021-04-30T05:30:42","guid":{"rendered":"https:\/\/play.datalude.com\/blog\/?p=639"},"modified":"2021-04-30T13:32:11","modified_gmt":"2021-04-30T05:32:11","slug":"node-package-manager-install-surprise-387-extra-packages","status":"publish","type":"post","link":"https:\/\/play.datalude.com\/blog\/2021\/04\/node-package-manager-install-surprise-387-extra-packages\/","title":{"rendered":"Node Package Manager install surprise. 387 extra packages!"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">I've got a server running Ubuntu 20, and wanted to try out something on it with nodejs. I checked on the server and apparently nodejs was already installed. I guess some previous dependency had put it on there a long time ago. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>node --version<br> v10.19.0<\/code><br><code>apt-cache policy nodejs<br> nodejs:<br> Installed: 10.19.0~dfsg-3ubuntu1<br> Candidate: 10.19.0~dfsg-3ubuntu1<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">OK, so the next thing I needed to do was to install node package manager, npm. (you might need to scroll down in  a second)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>apt install npm<br>Reading package lists\u2026 Done<br>Building dependency tree<br>Reading state information\u2026 Done<br>The following additional packages will be installed:<br>build-essential dpkg-dev fakeroot g++ g++-9 gyp libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libdata-dump-perl libdpkg-perl libdrm-amdgpu1 libdrm-intel1 libdrm-nouveau2 libdrm-radeon1 libfakeroot libfile-basedir-perl libfile-desktopentry-perl libfile-fcntllock-perl libfile-listing-perl libfile-mimeinfo-perl libfont-afm-perl libfontenc1 libgl1 libgl1-mesa-dri libglapi-mesa libglvnd0 libglx-mesa0 libglx0 libhtml-form-perl libhtml-format-perl libhtml-tree-perl libhttp-cookies-perl libhttp-daemon-perl libhttp-negotiate-perl libice6 libipc-system-simple-perl libjs-inherits libjs-is-typedarray libjs-psl libjs-typedarray-to-buffer libllvm11 liblwp-protocol-https-perl libnet-dbus-perl libnet-http-perl libnode-dev libpciaccess0 libpython2-stdlib libpython2.7-minimal libpython2.7-stdlib libsm6 libssl-dev libstdc++-9-dev libtie-ixhash-perl libtry-tiny-perl libuv1-dev libvulkan1 libwayland-client0 libwww-perl libwww-robotrules-perl libx11-protocol-perl libx11-xcb1 libxaw7 libxcb-dri2-0 libxcb-dri3-0 libxcb-glx0 libxcb-present0 libxcb-randr0 libxcb-shape0 libxcb-sync1 libxcb-xfixes0 libxcomposite1 libxcursor1 libxdamage1 libxfixes3 libxft2 libxi6 libxinerama1 libxkbfile1 libxml-parser-perl libxml-twig-perl libxml-xpathengine-perl libxmu6 libxrandr2 libxshmfence1 libxt6 libxtst6 libxv1 libxxf86dga1 libxxf86vm1 make mesa-vulkan-drivers node-abbrev node-ajv node-ansi node-ansi-align 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-bl node-bluebird node-boxen node-brace-expansion node-builtin-modules node-builtins node-cacache node-call-limit node-camelcase node-caseless node-chalk node-chownr node-ci-info node-cli-boxes node-cliui node-clone node-co node-color-convert node-color-name node-colors node-columnify node-combined-stream node-concat-map node-concat-stream node-config-chain node-configstore node-console-control-strings node-copy-concurrently node-core-util-is node-cross-spawn node-crypto-random-string node-cyclist node-dashdash node-debug node-decamelize node-decompress-response node-deep-extend node-defaults node-define-properties node-delayed-stream node-delegates node-detect-indent node-detect-newline node-dot-prop node-duplexer3 node-duplexify node-ecc-jsbn node-editor node-encoding node-end-of-stream node-err-code node-errno node-es6-promise node-escape-string-regexp node-execa node-extend node-extsprintf node-fast-deep-equal node-find-up node-flush-write-stream node-forever-agent node-form-data node-from2 node-fs-vacuum node-fs-write-stream-atomic node-fs.realpath node-function-bind node-gauge node-genfun node-get-caller-file node-get-stream node-getpass node-glob node-got node-graceful-fs node-gyp node-har-schema node-har-validator node-has-flag node-has-symbol-support-x node-has-to-string-tag-x node-has-unicode node-hosted-git-info node-http-signature node-iconv-lite node-iferr node-import-lazy node-imurmurhash node-inflight node-inherits node-ini node-invert-kv node-ip node-ip-regex node-is-npm node-is-obj node-is-object node-is-path-inside node-is-plain-obj node-is-retry-allowed node-is-stream node-is-typedarray node-isarray node-isexe node-isstream node-isurl 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-latest-version node-lazy-property node-lcid node-libnpx node-locate-path node-lockfile node-lodash node-lodash-packages node-lowercase-keys node-lru-cache node-make-dir node-mem node-mime node-mime-types node-mimic-fn node-mimic-response node-minimatch node-minimist node-mississippi node-mkdirp node-move-concurrently node-ms node-mute-stream node-nopt node-normalize-package-data node-npm-bundled node-npm-package-arg node-npm-run-path node-npmlog node-number-is-nan node-oauth-sign node-object-assign node-once node-opener node-os-locale node-os-tmpdir node-osenv node-p-cancelable node-p-finally node-p-is-promise node-p-limit node-p-locate node-p-timeout node-package-json node-parallel-transform node-path-exists node-path-is-absolute node-path-is-inside node-performance-now node-pify node-prepend-http node-process-nextick-args node-promise-inflight node-promise-retry node-promzard node-proto-list node-prr node-pseudomap node-psl node-pump node-pumpify node-punycode node-qs node-qw node-rc node-read node-read-package-json node-readable-stream node-registry-auth-token node-registry-url node-request node-require-directory node-require-main-filename node-resolve node-resolve-from node-retry node-rimraf node-run-queue node-safe-buffer node-semver node-semver-diff node-set-blocking node-sha node-shebang-command node-shebang-regex node-signal-exit node-slash node-slide node-sorted-object node-spdx-correct node-spdx-exceptions node-spdx-expression-parse node-spdx-license-ids node-sshpk node-ssri node-stream-each node-stream-iterate node-stream-shift node-strict-uri-encode node-string-decoder node-string-width node-strip-ansi node-strip-eof node-strip-json-comments node-supports-color node-tar node-term-size node-text-table node-through node-through2 node-timed-out node-tough-cookie node-tunnel-agent node-tweetnacl node-typedarray node-typedarray-to-buffer node-uid-number node-unique-filename node-unique-string node-unpipe node-uri-js node-url-parse-lax node-url-to-options node-util-deprecate node-uuid node-validate-npm-package-license node-validate-npm-package-name node-verror node-wcwidth.js node-which node-which-module node-wide-align node-widest-line node-wrap-ansi node-wrappy node-write-file-atomic node-xdg-basedir node-xtend node-y18n node-yallist node-yargs node-yargs-parser python-pkg-resources python2 python2-minimal python2.7 python2.7-minimal x11-common x11-utils x11-xserver-utils xdg-utils Suggested packages: debian-keyring g++-multilib g++-9-multilib gcc-9-doc bzr libcrypt-ssleay-perl libssl-doc libstdc++-9-doc libauthen-ntlm-perl libunicode-map8-perl libunicode-string-perl xml-twig-tools make-doc python-setuptools python2-doc python-tk python2.7-doc binfmt-support mesa-utils nickle cairo-5c xorg-docs-core The following NEW packages will be installed: build-essential dpkg-dev fakeroot g++ g++-9 gyp libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libdata-dump-perl libdpkg-perl libdrm-amdgpu1 libdrm-intel1 libdrm-nouveau2 libdrm-radeon1 libfakeroot libfile-basedir-perl libfile-desktopentry-perl libfile-fcntllock-perl libfile-listing-perl libfile-mimeinfo-perl libfont-afm-perl libfontenc1 libgl1 libgl1-mesa-dri libglapi-mesa libglvnd0 libglx-mesa0 libglx0 libhtml-form-perl libhtml-format-perl libhtml-tree-perl libhttp-cookies-perl libhttp-daemon-perl libhttp-negotiate-perl libice6 libipc-system-simple-perl libjs-inherits libjs-is-typedarray libjs-psl libjs-typedarray-to-buffer libllvm11 liblwp-protocol-https-perl libnet-dbus-perl libnet-http-perl libnode-dev libpciaccess0 libpython2-stdlib libpython2.7-minimal libpython2.7-stdlib libsm6 libssl-dev libstdc++-9-dev libtie-ixhash-perl libtry-tiny-perl libuv1-dev libvulkan1 libwayland-client0 libwww-perl libwww-robotrules-perl libx11-protocol-perl libx11-xcb1 libxaw7 libxcb-dri2-0 libxcb-dri3-0 libxcb-glx0 libxcb-present0 libxcb-randr0 libxcb-shape0 libxcb-sync1 libxcb-xfixes0 libxcomposite1 libxcursor1 libxdamage1 libxfixes3 libxft2 libxi6 libxinerama1 libxkbfile1 libxml-parser-perl libxml-twig-perl libxml-xpathengine-perl libxmu6 libxrandr2 libxshmfence1 libxt6 libxtst6 libxv1 libxxf86dga1 libxxf86vm1 make mesa-vulkan-drivers node-abbrev node-ajv node-ansi node-ansi-align 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-bl node-bluebird node-boxen node-brace-expansion node-builtin-modules node-builtins node-cacache node-call-limit node-camelcase node-caseless node-chalk node-chownr node-ci-info node-cli-boxes node-cliui node-clone node-co node-color-convert node-color-name node-colors node-columnify node-combined-stream node-concat-map node-concat-stream node-config-chain node-configstore node-console-control-strings node-copy-concurrently node-core-util-is node-cross-spawn node-crypto-random-string node-cyclist node-dashdash node-debug node-decamelize node-decompress-response node-deep-extend node-defaults node-define-properties node-delayed-stream node-delegates node-detect-indent node-detect-newline node-dot-prop node-duplexer3 node-duplexify node-ecc-jsbn node-editor node-encoding node-end-of-stream node-err-code node-errno node-es6-promise node-escape-string-regexp node-execa node-extend node-extsprintf node-fast-deep-equal node-find-up node-flush-write-stream node-forever-agent node-form-data node-from2 node-fs-vacuum node-fs-write-stream-atomic node-fs.realpath node-function-bind node-gauge node-genfun node-get-caller-file node-get-stream node-getpass node-glob node-got node-graceful-fs node-gyp node-har-schema node-har-validator node-has-flag node-has-symbol-support-x node-has-to-string-tag-x node-has-unicode node-hosted-git-info node-http-signature node-iconv-lite node-iferr node-import-lazy node-imurmurhash node-inflight node-inherits node-ini node-invert-kv node-ip node-ip-regex node-is-npm node-is-obj node-is-object node-is-path-inside node-is-plain-obj node-is-retry-allowed node-is-stream node-is-typedarray node-isarray node-isexe node-isstream node-isurl 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-latest-version node-lazy-property node-lcid node-libnpx node-locate-path node-lockfile node-lodash node-lodash-packages node-lowercase-keys node-lru-cache node-make-dir node-mem node-mime node-mime-types node-mimic-fn node-mimic-response node-minimatch node-minimist node-mississippi node-mkdirp node-move-concurrently node-ms node-mute-stream node-nopt node-normalize-package-data node-npm-bundled node-npm-package-arg node-npm-run-path node-npmlog node-number-is-nan node-oauth-sign node-object-assign node-once node-opener node-os-locale node-os-tmpdir node-osenv node-p-cancelable node-p-finally node-p-is-promise node-p-limit node-p-locate node-p-timeout node-package-json node-parallel-transform node-path-exists node-path-is-absolute node-path-is-inside node-performance-now node-pify node-prepend-http node-process-nextick-args node-promise-inflight node-promise-retry node-promzard node-proto-list node-prr node-pseudomap node-psl node-pump node-pumpify node-punycode node-qs node-qw node-rc node-read node-read-package-json node-readable-stream node-registry-auth-token node-registry-url node-request node-require-directory node-require-main-filename node-resolve node-resolve-from node-retry node-rimraf node-run-queue node-safe-buffer node-semver node-semver-diff node-set-blocking node-sha node-shebang-command node-shebang-regex node-signal-exit node-slash node-slide node-sorted-object node-spdx-correct node-spdx-exceptions node-spdx-expression-parse node-spdx-license-ids node-sshpk node-ssri node-stream-each node-stream-iterate node-stream-shift node-strict-uri-encode node-string-decoder node-string-width node-strip-ansi node-strip-eof node-strip-json-comments node-supports-color node-tar node-term-size node-text-table node-through node-through2 node-timed-out node-tough-cookie node-tunnel-agent node-tweetnacl node-typedarray node-typedarray-to-buffer node-uid-number node-unique-filename node-unique-string node-unpipe node-uri-js node-url-parse-lax node-url-to-options node-util-deprecate node-uuid node-validate-npm-package-license node-validate-npm-package-name node-verror node-wcwidth.js node-which node-which-module node-wide-align node-widest-line node-wrap-ansi node-wrappy node-write-file-atomic node-xdg-basedir node-xtend node-y18n node-yallist node-yargs node-yargs-parser npm python-pkg-resources python2 python2-minimal python2.7<br>0 upgraded, 378 newly installed, 0 to remove and 8 not upgraded.<br>Need to get 55.7 MB of archives.<br>After this operation, 514 MB of additional disk space will be used.<br>Do you want to continue? [Y\/n] n<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">No! No I do not want to continue! 378 packages? Are you mad? To install a package manager? No point, its already installed everything in the world. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So what to do. After a while I hit on this. First of all install node version mamager (nvm). This will let you grab a more recent version than the one in the Ubuntu repository. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code># instruction from the git repo https:\/\/github.com\/nvm-sh\/nvm<br>curl -o- https:\/\/raw.githubusercontent.com\/nvm-sh\/nvm\/v0.38.0\/install.sh | bash<\/code><br><br>And now we can get the latest version of nodejs. Hmm, 10.x to 16.x, that's quite a bump<br><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>nvm install node<br>  Downloading and installing node v16.0.0\u2026<br>nvm use node<br>  Now using node v16.0.0 (npm v7.10.0)<\/code><br><br>But wait &#8230; what's this &#8230; npm is already installed? <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>npm<br>Usage:<br>npm install install all the dependencies in your project<br>npm install add the dependency to your project<br><\/code><br>Bingo. So now we can use it without clogging everything up. TLDR: Use the version from the nodejs site, not the Ubuntu package. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>I've got a server running Ubuntu 20, and wanted to try out something on it with nodejs. I checked on the server and apparently nodejs was already installed. I guess some previous dependency had put it on there a long time ago. node &#8211;version v10.19.0apt-cache policy nodejs nodejs: Installed: 10.19.0~dfsg-3ubuntu1 Candidate: 10.19.0~dfsg-3ubuntu1 OK, so the &#8230; <a title=\"Node Package Manager install surprise. 387 extra packages!\" class=\"read-more\" href=\"https:\/\/play.datalude.com\/blog\/2021\/04\/node-package-manager-install-surprise-387-extra-packages\/\" aria-label=\"Read more about Node Package Manager install surprise. 387 extra packages!\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[1,4],"tags":[],"class_list":["post-639","post","type-post","status-publish","format-standard","hentry","category-it","category-linux"],"_links":{"self":[{"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/posts\/639","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/comments?post=639"}],"version-history":[{"count":0,"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/posts\/639\/revisions"}],"wp:attachment":[{"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/media?parent=639"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/categories?post=639"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/tags?post=639"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}