npm / cli

the package manager for JavaScript
https://docs.npmjs.com/cli/
Other
8.49k stars 3.17k forks source link

[BUG] npm can't install dependencies #1540

Closed seisdr closed 4 years ago

seisdr commented 4 years ago

here's a list if files into pdf.js

ameer@localhost:~/pdf.js$ ls -l
total 716
-rw-------.   1 ameer ameer    981 Jul 20 03:37 AUTHORS
-rw-------.   1 ameer ameer    691 Jul 20 03:37 CODE_OF_CONDUCT.md
-rw-------.   1 ameer ameer    342 Jul 20 03:37 EXPORT
-rw-------.   1 ameer ameer  10174 Jul 20 03:37 LICENSE
-rw-------.   1 ameer ameer   5161 Jul 20 03:37 README.md
drwx------.   5 ameer ameer   4096 Jul 20 03:37 docs
drwx------.  12 ameer ameer   4096 Jul 20 03:37 examples
drwx------.   4 ameer ameer   4096 Jul 20 03:37 extensions
drwx------.  10 ameer ameer   4096 Jul 20 03:37 external
-rw-------.   1 ameer ameer  53703 Jul 20 03:37 gulpfile.js
drwx------. 106 ameer ameer   4096 Jul 20 03:37 l10n
-rw-------.   1 ameer ameer 596442 Jul 20 03:37 package-lock.json
-rw-------.   1 ameer ameer   2160 Jul 20 03:37 package.json
-rw-------.   1 ameer ameer    149 Jul 20 03:37 pdfjs.config
drwx------.   6 ameer ameer   4096 Jul 20 03:37 src
-rw-------.   1 ameer ameer   3204 Jul 20 03:37 systemjs.config.js
drwx------.  10 ameer ameer   4096 Jul 20 03:37 test
drwx------.   3 ameer ameer   4096 Jul 20 03:37 web

here's a output when I attempt to install dependencies

ameer@localhost:~/pdf.js$ npm install
loadDevDep:yargs -> resol | |###################################---------------------------------------------------------------------------|
loadDevDep:yargs -> resol | |###################################---------------------------------------------------------------------------|
loadDevDep:yargs -> resol | |###################################---------------------------------------------------------------------------|
loadDevDep:yargs -> resol | |###################################---------------------------------------------------------------------------|
loadDevDep:yargs -> resol / |###################################---------------------------------------------------------------------------|
loadDevDep:yargs -> resol / |###################################---------------------------------------------------------------------------|
loadDevDep:yargs -> resol / |###################################---------------------------------------------------------------------------|
loadDevDep:yargs -> resol / |###################################---------------------------------------------------------------------------|
loadDevDep:yargs -> resol - |###################################---------------------------------------------------------------------------|
loadDevDep:yargs -> resol - |###################################---------------------------------------------------------------------------|
npm ERR! Linux 3.10.86-g0c14827
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! node v4.2.6
npm ERR! npm  v3.5.2
npm ERR! code EMISSINGARG

npm ERR! typeerror Error: Missing required argument #1
npm ERR! typeerror     at andLogAndFinish (/usr/share/npm/lib/fetch-package-metadata.js:31:3)
npm ERR! typeerror     at fetchPackageMetadata (/usr/share/npm/lib/fetch-package-metadata.js:51:22)
npm ERR! typeerror     at resolveWithNewModule (/usr/share/npm/lib/install/deps.js:456:12)
npm ERR! typeerror     at /usr/share/npm/lib/install/deps.js:457:7
npm ERR! typeerror     at /usr/share/npm/node_modules/iferr/index.js:13:50
npm ERR! typeerror     at /usr/share/npm/lib/fetch-package-metadata.js:37:12
npm ERR! typeerror     at addRequestedAndFinish (/usr/share/npm/lib/fetch-package-metadata.js:82:5)
npm ERR! typeerror     at returnAndAddMetadata (/usr/share/npm/lib/fetch-package-metadata.js:117:7)
npm ERR! typeerror     at pickVersionFromRegistryDocument (/usr/share/npm/lib/fetch-package-metadata.js:134:20)
npm ERR! typeerror     at /usr/share/npm/node_modules/iferr/index.js:13:50
npm ERR! typeerror This is an error with npm itself. Please report this error at:
npm ERR! typeerror     <http://github.com/npm/npm/issues>
WARN engine needle@2.5.0: wanted: {"node":">= 4.4.x"} (current: {"node":"4.2.6","npm":"3.5.2"})
WARN engine streamqueue@1.1.2: wanted: {"node":">=6.9.5"} (current: {"node":"4.2.6","npm":"3.5.2"})
WARN engine terser@4.8.0: wanted: {"node":">=6.0.0"} (current: {"node":"4.2.6","npm":"3.5.2"})
WARN engine web-streams-polyfill@2.1.1: wanted: {"node":">= 8"} (current: {"node":"4.2.6","npm":"3.5.2"})
WARN engine webpack-stream@5.0.0: wanted: {"node":">= 6.11.5"} (current: {"node":"4.2.6","npm":"3.5.2"})
WARN engine webpack@4.43.0: wanted: {"node":">=6.11.5"} (current: {"node":"4.2.6","npm":"3.5.2"})
WARN engine eslint@7.5.0: wanted: {"node":"^10.12.0 || >=12.0.0"} (current: {"node":"4.2.6","npm":"3.5.2"})
WARN engine eslint-plugin-prettier@3.1.4: wanted: {"node":">=6.0.0"} (current: {"node":"4.2.6","npm":"3.5.2"})
WARN engine puppeteer@3.3.0: wanted: {"node":">=10.18.1"} (current: {"node":"4.2.6","npm":"3.5.2"})

npm ERR! Please include the following file with any support request:
npm ERR!     /root/pdf.js/npm-debug.log
ameer@localhost:~/pdf.js$

here's a output when I try to update npm

^C
ameer@localhost:~/pdf.js$ npm install -g npm@latest
loadAllDepsIntoIdealTree  | |############---------------------------------------------|
WARN engine npm@6.14.6: wanted: {"node":"6 >=6.2.0 || 8 || >=9.3.0"} (current: {"node":"loadRequestedDeps         | |############---------------------------------------------|
WARN engine npm@6.14.6: wanted: {"node":"6 >=6.2.0 || 8 || >=9.3.0"} (current: {"node":"/usr/local/bin/npm -> /usr/local/lib/node_modules/npm/bin/npm-cli.js
/usr/local/bin/npx -> /usr/local/lib/node_modules/npm/bin/npx-cli.js
/usr/local/lib
+-- ansi-regex@2.1.1
+-- aproba@2.0.0
+-- aws4@1.8.0
+-- bin-links@1.1.7
+-- bluebird@3.5.5
+-- byte-size@5.0.1
+-- cacache@12.0.3
+-- call-limit@1.1.1
+-- chownr@1.1.4
+-- ci-info@2.0.0
+-- cli-table3@0.5.1
+-- cmd-shim@3.0.3
+-- config-chain@1.1.12
+-- extend@3.0.2
+-- figgy-pudding@3.5.1
+-- gentle-fs@2.3.0
+-- get-stream@4.1.0
+-- glob@7.1.6
+-- graceful-fs@4.2.4
+-- hosted-git-info@2.8.8
+-- iferr@1.0.2
+-- infer-owner@1.0.4
+-- inherits@2.0.4
+-- is-cidr@3.0.0
+-- is-fullwidth-code-point@1.0.0
+-- JSONStream@1.3.5
+-- libcipm@4.0.7
+-- libnpm@3.0.1
+-- libnpmaccess@3.0.2
+-- libnpmhook@5.0.3
+-- libnpmorg@1.0.1
+-- libnpmsearch@2.0.2
+-- libnpmteam@1.0.2
+-- libnpx@10.2.2
+-- lock-verify@2.1.0
+-- lru-cache@5.1.1
+-- make-fetch-happen@5.0.2
+-- mime-types@2.1.19
+-- mkdirp@0.5.5
+-- node-gyp@5.1.0
+-- nopt@4.0.3
+-- normalize-package-data@2.5.0
+-- npm@6.14.6
+-- npm-audit-report@1.3.2
+-- npm-install-checks@3.0.2
+-- npm-lifecycle@3.1.4
+-- npm-package-arg@6.1.1
+-- npm-packlist@1.4.8
+-- npm-pick-manifest@3.0.2
+-- npm-profile@4.0.4
+-- npm-registry-fetch@4.0.5
+-- opener@1.5.1
+-- pacote@9.5.12
+-- query-string@6.8.2
+-- read-cmd-shim@1.0.5
+-- read-package-json@2.1.1
+-- read-package-tree@5.3.1
+-- readable-stream@3.6.0
+-- readdir-scoped-modules@1.1.0
+-- request@2.88.0
+-- rimraf@2.7.1
+-- semver@5.7.1
+-- sha@3.0.0
+-- spdx-license-ids@3.0.5
+-- ssri@6.0.1
+-- stringify-package@1.0.1
+-- strip-ansi@3.0.1
+-- tar@4.4.13
+-- unique-filename@1.1.1
+-- update-notifier@2.5.0
+-- uuid@3.3.3
+-- validate-npm-package-license@3.0.4
+-- which@1.3.1
+-- worker-farm@1.7.0
`-- write-file-atomic@2.4.3

ameer@localhost:~/pdf.js$ 

I don't even know if it's updated or not and here's a log

npm-debug.log

seisdr commented 4 years ago

what's this

ameer@localhost:~/pdf.js$ npm install gulp-cli
/usr/local/lib/node_modules/npm/bin/npm-cli.js:87
      let notifier = require('update-notifier')({pkg})
      ^^^

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:374:25)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Function.Module.runMain (module.js:442:10)
    at startup (node.js:136:18)
    at node.js:966:3
ljharb commented 4 years ago

@seisdr it means you're using an ancient node version, and a too-new npm version for it. Upgrade node, or reinstall it and keep the older npm it comes with.

seisdr commented 4 years ago

but I did download the least using apt and I did upgrade npm using npm

ljharb commented 4 years ago

@seisdr do not ever install node or npm via apt. also, on old node versions, npm install -g npm will break your node installation, because newer npms don't work on older nodes, and once npm is broken, you have to reinstall node entirely.

seisdr commented 4 years ago

can I choice how many cores I want to use during build nodejs I can't use any other application as my ram is 2 gb

seisdr commented 4 years ago
Binary download failed, trying source.
grep: /proc/cpuinfo: Input/output error
Can not determine how many core(s) are available, running in single-threaded mode.
Please report an issue on GitHub to help us make nvm run faster on your computer!
Local cache found: ${NVM_DIR}/.cache/src/node-v14.5.0/node-v14.5.0.tar.xz
Checksums match! Using existing downloaded archive ${NVM_DIR}/.cache/src/node-v14.5.0/node-v14.5.0.tar.xz
seisdr commented 4 years ago

you can ignore it I'll compile it during night

seisdr commented 4 years ago

but I have i386 arch and it's not supported ? but I'm still building it