[Pkg-javascript-devel] Bug#969986: npm: Error: Cannot find module 'semver'

Kevin Locke kevin at kevinlocke.name
Wed Sep 9 18:54:43 BST 2020


Package: npm
Version: 6.14.8+ds-1
Severity: important

Dear Maintainer,

When I run `npm --version` (or any subcommand), it prints:

internal/modules/cjs/loader.js:968
  throw err;
  ^

Error: Cannot find module 'semver'
Require stack:
- /usr/share/npm/lib/utils/unsupported.js
- /usr/share/npm/bin/npm-cli.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
    at Function.Module._load (internal/modules/cjs/loader.js:841:27)
    at Module.require (internal/modules/cjs/loader.js:1025:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/usr/share/npm/lib/utils/unsupported.js:2:14)
    at Module._compile (internal/modules/cjs/loader.js:1137:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
    at Module.load (internal/modules/cjs/loader.js:985:32)
    at Function.Module._load (internal/modules/cjs/loader.js:878:14)
    at Module.require (internal/modules/cjs/loader.js:1025:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/usr/share/npm/lib/utils/unsupported.js',
    '/usr/share/npm/bin/npm-cli.js'
  ]
}

I am able to reproduce the error in a fresh chroot with:

debootstrap testing npm-chroot
chroot npm-chroot sh -c 'apt install -y npm && npm --version'

Any ideas?

Thanks,
Kevin


-- System Information:
Debian Release: bullseye/sid
  APT prefers testing-debug
  APT policy: (990, 'testing-debug'), (990, 'testing'), (500, 'unstable-debug'), (500, 'unstable'), (101, 'experimental'), (1, 'experimental-debug')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.8.7 (SMP w/4 CPU threads)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages npm depends on:
ii  ca-certificates                 20200601
ii  node-abbrev                     1.1.1-2
ii  node-ajv                        6.12.4-1
ii  node-ansi                       0.3.1-1
ii  node-ansi-regex                 5.0.0-1
ii  node-ansi-styles                4.2.1-1
ii  node-ansistyles                 0.1.3-2
ii  node-aproba                     2.0.0-1
ii  node-archy                      1.0.0-3
ii  node-are-we-there-yet           1.1.5-1
ii  node-asap                       2.0.6-2
ii  node-asn1                       0.2.3-2
ii  node-assert-plus                1.0.0-2
ii  node-asynckit                   0.4.0-3
ii  node-aws-sign2                  0.7.1-2
ii  node-aws4                       1.10.1-1
ii  node-balanced-match             1.0.0-1
ii  node-bcrypt-pbkdf               1.0.2-1
ii  node-bl                         4.0.3-1
ii  node-bluebird                   3.7.2+dfsg1-1
ii  node-boxen                      4.2.0-3
ii  node-brace-expansion            1.1.11-1
ii  node-builtin-modules            3.1.0-1
ii  node-builtins                   1.0.3-2
ii  node-cacache                    11.3.3-2
ii  node-call-limit                 1.1.1-1
ii  node-camelcase                  5.3.1-1
ii  node-caseless                   0.12.1-1
ii  node-chalk                      2.4.2-1
ii  node-chownr                     1.1.3-3
ii  node-ci-info                    2.0.0-1
ii  node-cli-boxes                  2.2.0-3
ii  node-cliui                      4.1.0-2
ii  node-clone                      2.1.2-2
ii  node-co                         4.6.0-3
ii  node-color-convert              1.9.3-1
ii  node-color-name                 1.1.4-1
ii  node-colors                     1.4.0-1
ii  node-columnify                  1.5.4-3
ii  node-combined-stream            1.0.8-1
ii  node-concat-map                 0.0.1-2
ii  node-concat-stream              2.0.0-1
ii  node-config-chain               1.1.12-1
ii  node-configstore                5.0.1-1
ii  node-console-control-strings    1.1.0-2
ii  node-copy-concurrently          1.0.5-5
ii  node-core-util-is               1.0.2-2
ii  node-crypto-random-string       3.2.0-1
ii  node-cyclist                    1.0.1-3
ii  node-dashdash                   1.14.1-3
ii  node-debbundle-es-to-primitive  1.2.1+~cs8.3.13-1
ii  node-debug                      4.1.1+~cs4.1.5-1
ii  node-decamelize                 4.0.0-1
ii  node-deep-extend                0.6.0-1
ii  node-defaults                   1.0.3-2
ii  node-define-properties          1.1.3-1
ii  node-delayed-stream             1.0.0-4
ii  node-delegates                  1.0.0-2
ii  node-detect-indent              6.0.0-1
ii  node-detect-newline             3.1.0-1
ii  node-dot-prop                   5.2.0-1
ii  node-duplexer3                  0.1.4-5
ii  node-duplexify                  4.1.1-1
ii  node-ecc-jsbn                   0.2.0-2
ii  node-editor                     1.0.0-2
ii  node-encoding                   0.1.12-3
ii  node-end-of-stream              1.4.4-1
ii  node-err-code                   2.0.0+dfsg-1
ii  node-errno                      0.1.7-2
ii  node-es6-promise                4.2.8-7
ii  node-escape-string-regexp       4.0.0-1
ii  node-execa                      0.10.0+dfsg-1
ii  node-extend                     3.0.2-1
ii  node-extsprintf                 1.3.0-1
ii  node-fast-deep-equal            1.1.0-1
ii  node-find-up                    4.1.0-2
ii  node-flush-write-stream         2.0.0-2
ii  node-forever-agent              0.6.1-2
ii  node-form-data                  3.0.0-2
ii  node-from2                      2.3.0-1
ii  node-fs-vacuum                  1.2.10-3
ii  node-fs-write-stream-atomic     1.0.10-4
ii  node-fs.realpath                1.0.0-1
ii  node-function-bind              1.1.1+repack-1
ii  node-gauge                      2.7.4-1
ii  node-genfun                     5.0.0-1
ii  node-get-caller-file            1.0.2-1
ii  node-getpass                    0.1.7-1
ii  node-glob                       7.1.6-1
ii  node-got                        7.1.0-1
ii  node-graceful-fs                4.2.4-1
ii  node-gyp                        7.0.0-1
ii  node-har-schema                 2.0.0-3
ii  node-har-validator              5.1.3-1
ii  node-has-flag                   4.0.0-1
ii  node-has-unicode                2.0.1-2
ii  node-hosted-git-info            2.8.5-1
ii  node-http-signature             1.3.2-1
ii  node-iconv-lite                 0.5.1-3
ii  node-iferr                      1.0.2-1
ii  node-import-lazy                3.0.0.REALLY.2.1.0-1
ii  node-imurmurhash                0.1.4-1
ii  node-inflight                   1.0.6-1
ii  node-inherits                   2.0.4-1
ii  node-ini                        1.3.5-1
ii  node-invert-kv                  3.0.1-1
ii  node-ip                         1.1.5-5
ii  node-ip-regex                   4.1.0-2
ii  node-is-npm                     1.0.0-1
ii  node-is-obj                     1.0.1-2
ii  node-is-path-inside             1.0.1-1
ii  node-is-retry-allowed           1.1.0-1
ii  node-is-stream                  1.1.0-1
ii  node-is-typedarray              1.0.0-2.1
ii  node-isarray                    2.0.5-1
ii  node-isexe                      2.0.0-4
ii  node-isstream                   0.1.2+dfsg-1
ii  node-jsbn                       1.1.0-1
ii  node-json-parse-better-errors   1.0.2-2
ii  node-json-schema                0.2.3-1
ii  node-json-schema-traverse       0.3.1-1
ii  node-json-stringify-safe        5.0.1+repack-2
ii  node-jsonparse                  1.3.1-7
ii  node-jsonstream                 1.3.5-1
ii  node-jsprim                     1.4.1-1
ii  node-latest-version             3.1.0-1
ii  node-lazy-property              1.0.0-3
ii  node-lcid                       1.0.0-1
ii  node-libnpx                     10.2.1-2
ii  node-locate-path                5.0.0-2
ii  node-lockfile                   1.0.4-3
ii  node-lodash                     4.17.19+dfsg1-1
ii  node-lowercase-keys             2.0.0-1
ii  node-lru-cache                  5.1.1-5
ii  node-make-dir                   3.0.2-1
ii  node-mem                        1.1.0-1
ii  node-mime                       2.4.5+dfsg+~cs2.46.0-1
ii  node-mime-types                 2.1.25-1
ii  node-mimic-fn                   3.0.0-1
ii  node-minimatch                  3.0.4-4
ii  node-minimist                   1.2.5-1
ii  node-mississippi                3.0.0-1
ii  node-mkdirp                     0.5.1-2
ii  node-move-concurrently          1.0.1-2
ii  node-ms                         2.1.2+~cs0.7.31-1
ii  node-mute-stream                0.0.8-2
ii  node-nopt                       3.0.6-4
ii  node-normalize-package-data     2.5.0-1
ii  node-npm-bundled                1.1.1-1
ii  node-npm-package-arg            6.1.1-1
ii  node-npmlog                     4.1.2-2
ii  node-number-is-nan              2.0.0-1
ii  node-oauth-sign                 0.9.0-2
ii  node-object-assign              4.1.1-3
ii  node-once                       1.4.0-3
ii  node-opener                     1.5.1-1
ii  node-os-locale                  4.0.0-1
ii  node-os-tmpdir                  1.0.2-1
ii  node-osenv                      0.1.5-1
ii  node-p-finally                  1.0.0-2
ii  node-p-is-promise               3.0.0-1
ii  node-p-limit                    2.2.2-1
ii  node-p-locate                   2.0.0-1
ii  node-package-json               4.0.1-1
ii  node-parallel-transform         1.1.0-2
ii  node-path-exists                4.0.0-2
ii  node-path-is-absolute           2.0.0-1
ii  node-path-is-inside             1.0.2-1
ii  node-performance-now            2.1.0+debian-1
ii  node-pify                       3.0.0-1
ii  node-prepend-http               3.0.1-1
ii  node-process-nextick-args       2.0.0-1
ii  node-promise-inflight           1.0.1-1
ii  node-promise-retry              1.1.1-4
ii  node-promzard                   0.3.0-1
ii  node-proto-list                 1.2.4-1
ii  node-prr                        1.0.1-1
ii  node-pseudomap                  1.0.2-1
ii  node-psl                        1.7.0+ds-2
ii  node-pump                       3.0.0-4
ii  node-pumpify                    2.0.1-1
ii  node-punycode                   2.1.1-3
ii  node-qs                         6.9.1+ds-1
ii  node-qw                         1.0.1-1
ii  node-rc                         1.2.8-1
ii  node-read                       1.0.7-2
ii  node-read-package-json          2.1.1-1
ii  node-readable-stream            3.4.0-2
ii  node-registry-auth-token        3.3.1-1
ii  node-registry-url               3.1.0-1
ii  node-require-directory          2.1.1-1
ii  node-require-main-filename      2.0.0-1
ii  node-resolve-from               4.0.0-1
ii  node-retry                      0.12.0-1
ii  node-rimraf                     2.6.3-1
ii  node-run-queue                  1.0.3-1
ii  node-safe-buffer                5.2.0-1
ii  node-semver                     7.1.3-1
ii  node-semver-diff                2.1.0-2
ii  node-set-blocking               2.0.0-1
ii  node-sha                        3.0.0-1
ii  node-shebang-command            1.2.0-1
ii  node-shebang-regex              2.0.0-1
ii  node-signal-exit                3.0.3-1
ii  node-slash                      3.0.0-1
ii  node-slide                      1.1.6-2
ii  node-sorted-object              2.0.1-1
ii  node-spdx-correct               3.1.1-1
ii  node-spdx-exceptions            2.3.0-1
ii  node-spdx-expression-parse      3.0.0-1
ii  node-spdx-license-ids           3.0.5-1
ii  node-sshpk                      1.16.1+dfsg-2
ii  node-ssri                       8.0.0-1
ii  node-stream-each                1.2.3-1
ii  node-stream-iterate             1.2.0-4
ii  node-stream-shift               1.0.1-1
ii  node-strict-uri-encode          2.0.0-1
ii  node-string-decoder             1.3.0-1
ii  node-string-width               4.2.0-1
ii  node-strip-ansi                 6.0.0-2
ii  node-strip-eof                  1.0.0-2
ii  node-strip-json-comments        3.1.1-1
ii  node-supports-color             6.1.0-2
ii  node-tar                        4.4.10+ds1-2
ii  node-term-size                  1.2.0+dfsg-2
ii  node-text-table                 0.2.0-2
ii  node-through                    2.3.8-1
ii  node-through2                   3.0.1-2
ii  node-timed-out                  4.0.1-5
ii  node-tough-cookie               3.0.0-1
ii  node-tunnel-agent               0.6.1-2
ii  node-tweetnacl                  1.0.3+dfsg-1
ii  node-typedarray                 0.0.6-1
ii  node-uid-number                 0.0.6-1
ii  node-unique-filename            1.1.1+ds-1
ii  node-unique-string              1.0.0-2
ii  node-unpipe                     1.0.0-1
ii  node-url-parse-lax              1.0.0-1
ii  node-util-deprecate             1.0.2-1
ii  node-uuid                       3.3.2-2
ii  node-validate-npm-package-name  3.0.0-1
ii  node-verror                     1.10.0-1
ii  node-wcwidth.js                 1.0.0-1
ii  node-which                      2.0.2-2
ii  node-which-module               2.0.0-1
ii  node-wide-align                 1.1.3-1
ii  node-widest-line                3.1.0-1
ii  node-wrap-ansi                  4.0.0-2
ii  node-wrappy                     1.0.2-1
ii  node-write-file-atomic          3.0.3-1
ii  node-xdg-basedir                3.0.0-1
ii  node-xtend                      4.0.2-1
ii  node-y18n                       4.0.0-2
ii  node-yallist                    4.0.0-1
ii  node-yargs                      15.3.1-1
ii  node-yargs-parser               18.1.3-1
ii  nodejs                          12.18.3~dfsg-4

npm recommends no packages.

npm suggests no packages.



More information about the Pkg-javascript-devel mailing list