npm installation errorno -104 - node.js

I am trying to install a package tree-sitter-cli using the latest npm
❯ npm -v
8.6.0
But keep getting the following error.
63 timing command:i Completed in 885ms
64 verbose stack Error: command failedche/_logs/2022-04-04T12_58_29_622Z-debug-0.log
64 verbose stack at ChildProcess.<anonymous> (~/.local/lib/node_modules/npm/node_
modules/#npmcli/promise-spawn/index.js:64:27)
64 verbose stack at ChildProcess.emit (node:events:527:28)
64 verbose stack at maybeClose (node:internal/child_process:1090:16)
64 verbose stack at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
65 verbose pkgid tree-sitter-cli#0.20.6
66 verbose cwd /glb/home/innnei
67 verbose Linux 3.10.0-1160.53.1.el7.x86_64
68 verbose node v17.8.0
69 verbose npm v8.6.0
70 error code 1
71 error path ~/.local/lib/node_modules/tree-sitter-cli
72 error command failed
73 error command sh -c node install.js
74 error Downloading https://github.com/tree-sitter/tree-sitter/releases/download/v0.20.6/tree-sitter-linux-x64.gz
75 error node:events:505
75 error throw er; // Unhandled 'error' event
75 error ^
75 error
75 error Error: read ECONNRESET
75 error at TLSWrap.onStreamRead (node:internal/stream_base_commons:217:20)
75 error Emitted 'error' event on ClientRequest instance at:
75 error at TLSSocket.socketErrorListener (node:_http_client:454:9)
75 error at TLSSocket.emit (node:events:527:28)
75 error at emitErrorNT (node:internal/streams/destroy:164:8)
75 error at emitErrorCloseNT (node:internal/streams/destroy:129:3)
75 error at processTicksAndRejections (node:internal/process/task_queues:83:21) {
75 error errno: -104,
75 error code: 'ECONNRESET',
75 error syscall: 'read'
75 error }
75 error
75 error Node.js v17.8.0
76 verbose exit 1
77 timing npm Completed in 1349ms
78 verbose unfinished npm timer reify 1649077110082
79 verbose unfinished npm timer reify:audit 1649077110203
80 verbose unfinished npm timer auditReport:getReport 1649077110203
81 verbose unfinished npm timer reify:build 1649077110257
82 verbose unfinished npm timer build 1649077110257
83 verbose unfinished npm timer build:deps 1649077110257
84 verbose unfinished npm timer build:run:install 1649077110261
85 verbose unfinished npm timer build:run:install:node_modules/tree-sitter-cli 1649077110262
86 verbose code 1
I am behind a corporate proxy (proxy setting is set through shell variables http_proxy & https_proxy ) and npm is working with the proxy settings
❯ npm ping
npm notice PING https://registry.npmjs.org/
npm notice PONG 819ms
This (node & npm) is not really my area of expertise, so I need help in understanding & diagnosing the error.
My npm config is
cache = "~/.local/npmcache"
registry = "https://registry.npmjs.org/"
; "cli" config from command line options
global = true
; node bin location = ~/.local/bin/node
; cwd = $HOME/innnei
; HOME = $HOME/innnei
; Run `npm config ls -l` to show all defaults.

The problem happens when I tried to create a new app using npx create-react-app test-app
after some tries the problem got solved with this command.
npx clear-npx-cache
then after closing the visual studio code editor so that it releases some caches too.
this trick is from this answer
Give it a try.

Related

npm ERR! Cannot read properties of undefined (reading 'name')

I have windows 10 laptop. Node.js version is v.16.15.1 and npm version is 8.13.2. I run 'npm install' in terminal and it gives me erors:
npm ERR! Cannot read properties of undefined (reading 'name')
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\h\AppData\Local\npm-cache\_logs\2022-07-07T08_33_12_931Z-debug-0.log
next i open debug-0.log:
45 verbose stack TypeError: Cannot read properties of undefined (reading 'name')
45 verbose stack at C:\Users\h\AppData\Roaming\npm\node_modules\npm\node_modules\#npmcli\arborist\lib\arborist\reify.js:285:30
48 verbose node v16.15.1
49 verbose npm v8.13.2
50 error Cannot read properties of undefined (reading 'name')
51 verbose exit 1
52 timing npm Completed in 213ms
53 verbose unfinished npm timer reify 1657134370529
54 verbose unfinished npm timer reify:loadTrees 1657134370538
55 verbose code 1
56 error A complete log of this run can be found in:
56 error C:\Users\h\AppData\Local\npm-cache\_logs\2022-07-06T19_06_10_353Z-debug-0.log

Cannot Install FIREBASE via NPM GLOBALLY (Error 127)

I cannot install firebase via npm install -g firebase.
I receive the following error that I could not find a solution for:
The issue seem to be relatedd to core-js & protobufjs which cannot be postinstall.
Note: I did reinstall node.js multiple times already - without any luck.
51 http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/advisories/bulk 374ms
52 timing auditReport:getReport Completed in 377ms
53 silly audit report {}
54 timing auditReport:init Completed in 0ms
55 timing reify:audit Completed in 377ms
56 timing reifyNode:node_modules/#firebase/polyfill/node_modules/core-js Completed in 1368ms
57 timing reifyNode:node_modules/core-js Completed in 1470ms
58 timing reify:unpack Completed in 1470ms
59 timing reify:unretire Completed in 0ms
60 timing build:queue Completed in 1ms
61 info run core-js#3.18.1 postinstall node_modules/core-js node -e "try{require('./postinstall')}catch(e){}"
62 info run core-js#3.6.5 postinstall node_modules/#firebase/polyfill/node_modules/core-js node -e "try{require('./postinstall')}catch(e){}"
63 info run core-js#3.18.1 postinstall { code: 127, signal: null }
64 info run core-js#3.6.5 postinstall { code: 127, signal: null }
65 timing reify:rollback:createSparse Completed in 338ms
66 timing reify:rollback:retireShallow Completed in 31ms
67 timing command:install Completed in 2501ms
68 verbose stack Error: command failed
68 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs2\node_modules\npm\node_modules\#npmcli\promise-spawn\index.js:64:27)
68 verbose stack at ChildProcess.emit (node:events:390:28)
68 verbose stack at maybeClose (node:internal/child_process:1064:16)
68 verbose stack at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
69 verbose pkgid core-js#3.18.1
70 verbose cwd C:\Users\chmit_000
71 verbose Windows_NT 10.0.19042
72 verbose argv "C:\\Program Files\\nodejs2\\node.exe" "C:\\Program Files\\nodejs2\\node_modules\\npm\\bin\\npm-cli.js" "install" "core-js"
73 verbose node v16.10.0
74 verbose npm v7.24.0
75 error code 127
76 error path C:\Users\chmit_000\node_modules\core-js
77 error command failed
78 error command bash -c node -e "try{require('./postinstall')}catch(e){}"
79 error /bin/bash: node: command not found
80 verbose exit 127
The package meant for global installation is firebase-tools. That's the CLI used for deploying your app (or parts of it) to firebase, as well as performing other administrative tasks. The firebase package is the library used for accessing firebase backend/cloud functions in a web/mobile project.
If you're looking to install the CLI, run npm install -g firebase-tools.
Here are links to both packages:
firebase
firebase-tools

Git bash doesn't execute npm install

I keep getting this error in Git Bash when trying to do an npm install:
64 verbose stack Error: command failed
64 verbose stack at ChildProcess.<anonymous> (C:\Users\baseuser\AppData\Roaming\npm\node_modules\npm\node_modules\#npmcli\promise-spawn\index.js:64:27)
64 verbose stack at ChildProcess.emit (events.js:400:28)
64 verbose stack at maybeClose (internal/child_process.js:1058:16)
64 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:293:5)
65 verbose pkgid app-backend#1.0.1-dev.0
66 verbose cwd C:\work\gitrepo\app-backend
67 verbose Windows_NT 10.0.18363
68 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\baseuser\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
69 verbose node v14.18.0
70 verbose npm v8.0.0
71 error code 1
72 error path C:\work\gitrepo\app-backend
73 error command failed
74 error command C:\windows\system32\cmd.exe /d /s /c npm run build
75 verbose exit 1
I have node and npm installed globally and npm install works in Powershell or Windows Command line, but not in Git Bash for some reason. I have them added to PATH variable. I done npm clear cache -force but nothing changed.
Removed node, npm, git with git bash and reinstalled them againt, and the error still present.
this issue happened recently to many ppl earlier in the last 2 weeks , it seems like a problem withh package distrepution .
To fix this try cloning your library to different location . going into the packages/dscc-scripts directory and running the build command. You can then point all of the scripts from the package.json dscc-gen made to the packages/dscc-scripts/index.js file. Bit of a hack, but good for the quick fix.

jasmine version error while running ng new command

I am getting error while running ng new command
below error is fired during the ng new Project-Name-Here
Could not resolve dependency:
error peer jasmine-core#">=3.7.1" from karma-jasmine-html-reporter#1.6.0
silly fetch manifest jasmine-core#>=3.7.1
83 timing idealTree Completed in 8839ms
84 timing command:install Completed in 8849ms
85 verbose stack Error: unable to resolve dependency tree
85 verbose stack at Arborist.[failPeerConflict] (C:\Program Files\nodejs\node_modules\npm\node_modules\#npmcli\arborist\lib\arborist\build-ideal-tree.js:1141:25)
85 verbose stack at Arborist.[loadPeerSet] (C:\Program Files\nodejs\node_modules\npm\node_modules\#npmcli\arborist\lib\arborist\build-ideal-tree.js:1118:34)
85 verbose stack at async Arborist.[buildDepStep] (C:\Program Files\nodejs\node_modules\npm\node_modules\#npmcli\arborist\lib\arborist\build-ideal-tree.js:836:11)
85 verbose stack at async Arborist.buildIdealTree (C:\Program Files\nodejs\node_modules\npm\node_modules\#npmcli\arborist\lib\arborist\build-ideal-tree.js:209:7)
85 verbose stack at async Promise.all (index 1)
85 verbose stack at async Arborist.reify (C:\Program Files\nodejs\node_modules\npm\node_modules\#npmcli\arborist\lib\arborist\reify.js:130:5)
85 verbose stack at async install (C:\Program Files\nodejs\node_modules\npm\lib\install.js:38:3)
86 verbose cwd C:\Users\PYH0JFQ\source\Hospital\Patient
87 verbose Windows_NT 10.0.19041
88 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--quiet"
89 verbose node v15.11.0
90 verbose npm v7.6.0
91 error code ERESOLVE
92 error ERESOLVE unable to resolve dependency tree
93 error
94 error While resolving: patient#0.0.0
94 error Found: jasmine-core#3.6.0
94 error node_modules/jasmine-core
94 error dev jasmine-core#"~3.6.0" from the root project
94 error
94 error Could not resolve dependency:
94 error peer jasmine-core#">=3.7.1" from karma-jasmine-html-reporter#1.6.0
94 error node_modules/karma-jasmine-html-reporter
94 error dev karma-jasmine-html-reporter#"^1.5.0" from the root project
94 error
94 error Fix the upstream dependency conflict, or retry
94 error this command with --force, or --legacy-peer-deps
94 error to accept an incorrect (and potentially broken) dependency resolution.
I have faced the same issue recently and i got to know this from an online instructor.
you should have phrase the question neatly, anyways
This error is caused by an npm 7 issue. The Angular team recommends to use npm 6 for now.
so downgrade the npm 7 to npm 6 for now
npm install -g npm#6
or
An alternative can be to run ng new with the --skipInstall flag, and then install the dependencies with npm install --legacy-peer-deps.
I found, what I feel is, a better solution.
After running the ng new - go into package.json and simply change
"jasmine-core": "~3.7.0",
to
"jasmine-core": "~3.8.0",
and then run npm install afterwards.

Webpack not installing on linux

Recently i changed my environment from windows 10 to backbox linux 4.5.1 but i have tried to install webpack using npm several times . It never installs it gives these errors. Any help ?
verbose tar unpack /home/dove/.npm/webpack/1.12.13/package.tgz
34 silly lockFile 27155615-tar-usr-lib-node-modules-webpack tar:///usr/lib/node_modules/webpack
35 verbose lock tar:///usr/lib/node_modules/webpack /home/dove/.npm/27155615-tar-usr-lib-node-modules-webpack.lock
36 silly lockFile 5c48f9fd--npm-webpack-1-12-13-package-tgz tar:///home/dove/.npm/webpack/1.12.13/package.tgz
37 verbose lock tar:///home/dove/.npm/webpack/1.12.13/package.tgz /home/dove/.npm/5c48f9fd--npm-webpack-1-12-13-package-tgz.lock
38 silly gunzTarPerm modes [ '775', '664' ]
39 error Error: EACCES, mkdir '/usr/lib/node_modules/webpack'
39 error { [Error: EACCES, mkdir '/usr/lib/node_modules/webpack']
39 error errno: 3,
39 error code: 'EACCES',
39 error path: '/usr/lib/node_modules/webpack',
39 error fstream_type: 'Directory',
39 error fstream_path: '/usr/lib/node_modules/webpack',
39 error fstream_class: 'DirWriter',
39 error fstream_stack:
39 error [ '/usr/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23',
39 error '/usr/lib/node_modules/npm/node_modules/mkdirp/index.js:46:53',
39 error 'Object.oncomplete (fs.js:108:15)' ] }
40 error Please try running this command again as root/Administrator.
41 error System Linux 4.2.0-30-generic
42 error command "/usr/bin/node" "/usr/bin/npm" "install" "-g" "webpack#1.12.13"
43 error cwd /home/dove/projects/yulu
44 error node -v v0.10.37
45 error npm -v 1.4.28
46 error path /usr/lib/node_modules/webpack
47 error fstream_path /usr/lib/node_modules/webpack
48 error fstream_type Directory
49 error fstream_class DirWriter
50 error code EACCES
51 error errno 3
52 error stack Error: EACCES, mkdir '/usr/lib/node_modules/webpack'
53 error fstream_stack /usr/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23
53 error fstream_stack /usr/lib/node_modules/npm/node_modules/mkdirp/index.js:46:53
53 error fstream_stack Object.oncomplete (fs.js:108:15)
54 verbose exit [ 3, true ]
I think problem is about trying to install npm without sudo privileges since it gave an access error.
"Error: EACCES, mkdir '/usr/lib/node_modules/webpack'"
you should try to run your command with prefix of "sudo"
sudo "your-command"
Also you can try this command too.
npm config set unsafe-perm=true
There is a discussion about this error in github you might want to check it out.
https://github.com/Microsoft/BashOnWindows/issues/14

Resources