Cannot Install FIREBASE via NPM GLOBALLY (Error 127) - node.js

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

Related

Installing npm sharp module on Ubuntu failed

I faced issue while was trying to install sharp module on ubuntu server.
I tried to install it to my project folder but had no success there.
I had a guess that this might happen due to some conflicts with current modules. After that I tried to install it to the new folder with no modules in it, but result was the same.
The issue flow is next. I try to install sharp module, then it stuck in this state (I waited for around an hour and nothing changed).
(##################) ⠼ reify:sharp: timing reifyNode:node_modules/semver Completed in 145ms
After that I pressed ctrl+c and here is the error that I got
root#ubuntu-front:/var/tmp/tes# npm i sharp
npm ERR! path /var/tmp/tes/node_modules/sharp
npm ERR! command failed
npm ERR! signal SIGINT
npm ERR! command sh /tmp/install-4252fa98.sh
npm ERR! sharp: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.13.2/libvips-8.13.2-linux-x64.tar.br
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-10-12T12_56_38_692Z-debug-0.log
And here is output from the dump file
288 info run sharp#0.31.1 install node_modules/sharp (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
289 http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/advisories/bulk 275ms
290 timing auditReport:getReport Completed in 278ms
291 silly audit report {}
292 timing auditReport:init Completed in 0ms
293 timing reify:audit Completed in 279ms
294 info run sharp#0.31.1 install { code: null, signal: 'SIGINT' }
295 timing reify:rollback:createSparse Completed in 34ms
296 timing reify:rollback:retireShallow Completed in 0ms
297 timing command:i Completed in 21196ms
298 verbose stack Error: command failed
298 verbose stack at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/#npmcli/promise-spawn/lib/index.js:63:27)
298 verbose stack at ChildProcess.emit (node:events:513:28)
298 verbose stack at maybeClose (node:internal/child_process:1093:16)
298 verbose stack at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
299 verbose pkgid sharp#0.31.1
300 verbose cwd /var/tmp/tes
301 verbose Linux 5.15.0-48-generic
302 verbose node v16.17.0
303 verbose npm v8.15.0
304 error path /var/tmp/tes/node_modules/sharp
305 error command failed
306 error signal SIGINT
307 error command sh /tmp/install-4252fa98.sh
308 error sharp: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.13.2/libvips-8.13.2-linux-x64.tar.br
309 verbose exit 1
310 timing npm Completed in 21266ms
311 verbose unfinished npm timer reify 1665579398761
312 verbose unfinished npm timer reify:build 1665579400052
313 verbose unfinished npm timer build 1665579400052
314 verbose unfinished npm timer build:deps 1665579400052
315 verbose unfinished npm timer build:run:install 1665579400057
316 verbose unfinished npm timer build:run:install:node_modules/sharp 1665579400057
317 verbose code 1
318 error A complete log of this run can be found in:
318 error /root/.npm/_logs/2022-10-12T12_56_38_692Z-debug-0.log
I found some similar issues in the Internet but all of them were slightly different and suggested solutions didn't help in my case.
Here are the versions
# node -v
v16.17.0
# npm -v
8.15.0
# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.1 LTS
Release: 22.04
Codename: jammy

npm installation errorno -104

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.

npm install error: npm ERR! Cannot read property 'insert' of undefined

Trying to install express or any other package with npm brings forth this error
"npm ERR! Cannot read property 'insert' of undefined"
Ubuntu 22.04 LTS
npm#8.5.1
node#v12.22
Sections of debug log
0 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'install', 'express' ]
1 info using npm#8.5.1
2 info using node#v12.22.9
23 verbose logfile /home/kiama/.npm/_logs/2022-04-25T18_29_12_505Z-debug-0.log
24 timing npm:load:logFile Completed in 12ms
25 timing npm:load:timers Completed in 0ms
26 timing npm:load:configScope Completed in 0ms
27 timing npm:load Completed in 73ms
28 timing arborist:ctor Completed in 2ms
29 silly logfile start cleaning logs, removing 1 files
34 silly fetch manifest express#*
35 silly placeDep ROOT express# OK for: server#1.0.0 want: *
36 timing idealTree:#root Completed in 458ms
37 timing idealTree:node_modules/express Completed in 1ms
38 timing idealTree:buildDeps Completed in 462ms
39 timing idealTree:fixDepFlags Completed in 0ms
40 timing idealTree Completed in 513ms
41 timing command:install Completed in 579ms
42 verbose stack TypeError: Cannot read property 'insert' of undefined
42 verbose stack at CacheEntry.store (/usr/share/nodejs/npm/node_modules/make-fetch-happen/lib/cache/entry.js:325:27)
42 verbose stack at cacheFetch (/usr/share/nodejs/npm/node_modules/make-fetch-happen/lib/cache/index.js:18:18)
44 verbose Linux 5.15.0-25-generic
45 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" "express"
46 verbose node v12.22.9
47 verbose npm v8.5.1
48 error Cannot read property 'insert' of undefined

npm install show error code 1 and delete node_modules folder and abort everything

I am trying to use generative-art-node by HashLips GitHub. I downloaded the script, then the instructions were as follows to install nodejs, they say within the folder run terminal npm install here where the trouble comes in. I get an error and abortion during the installation and the below changelog appears.
0 verbose cli [
0 verbose cli 'C:\\Program Files (x86)\\nodejs\\node.exe',
0 verbose cli 'C:\\Users\\A7\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
0 verbose cli 'install'
0 verbose cli ]
1 info using npm#8.3.2
2 info using node#v16.13.2
3 timing npm:load:whichnode Completed in 1ms
4 timing config:load:defaults Completed in 1ms
5 timing config:load:file:C:\Users\A7\AppData\Roaming\npm\node_modules\npm\npmrc Completed in 2ms
6 timing config:load:builtin Completed in 2ms
7 timing config:load:cli Completed in 1ms
8 timing config:load:env Completed in 1ms
9 timing config:load:file:C:\Users\A7\Desktop\generative-art-node-main\.npmrc Completed in 1ms
10 timing config:load:project Completed in 1ms
11 timing config:load:file:C:\Users\A7\.npmrc Completed in 1ms
12 timing config:load:user Completed in 1ms
13 timing config:load:file:C:\Users\A7\AppData\Roaming\npm\etc\npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:validate Completed in 2ms
16 timing config:load:credentials Completed in 1ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 13ms
19 timing npm:load:configload Completed in 13ms
20 timing npm:load:setTitle Completed in 0ms
21 timing config:load:flatten Completed in 3ms
22 timing npm:load:display Completed in 5ms
23 verbose logfile C:\Users\A7\AppData\Local\npm-cache\_logs\2022-01-23T18_50_51_726Z-debug-0.log
24 timing npm:load:logFile Completed in 7ms
25 timing npm:load:timers Completed in 0ms
26 timing npm:load:configScope Completed in 0ms
27 timing npm:load Completed in 27ms
28 timing arborist:ctor Completed in 1ms
29 silly logfile start cleaning logs, removing 1 files
30 timing idealTree:init Completed in 71ms
31 timing idealTree:userRequests Completed in 1ms
32 silly idealTree buildDeps
33 timing idealTree:#root Completed in 1ms
34 timing idealTree:buildDeps Completed in 1ms
35 timing idealTree:fixDepFlags Completed in 0ms
36 timing idealTree Completed in 75ms
37 timing reify:loadTrees Completed in 82ms
38 timing reify:diffTrees Completed in 3ms
39 silly reify moves {}
40 timing reify:retireShallow Completed in 1ms
41 timing reify:createSparse Completed in 29ms
42 timing reify:loadBundles Completed in 0ms
43 silly audit bulk request {
43 silly audit '#mapbox/node-pre-gyp': [ '1.0.5' ],
43 silly audit abbrev: [ '1.1.1' ],
43 silly audit 'agent-base': [ '6.0.2' ],
43 silly audit 'ansi-regex': [ '2.1.1' ],
43 silly audit aproba: [ '1.2.0' ],
43 silly audit 'are-we-there-yet': [ '1.1.5' ],
43 silly audit 'balanced-match': [ '1.0.2' ],
43 silly audit 'brace-expansion': [ '1.1.11' ],
43 silly audit canvas: [ '2.8.0' ],
43 silly audit chownr: [ '2.0.0' ],
43 silly audit 'code-point-at': [ '1.1.0' ],
43 silly audit 'concat-map': [ '0.0.1' ],
43 silly audit 'console-control-strings': [ '1.1.0' ],
43 silly audit 'core-util-is': [ '1.0.2' ],
43 silly audit debug: [ '4.3.2' ],
43 silly audit 'decompress-response': [ '4.2.1' ],
43 silly audit delegates: [ '1.0.0' ],
43 silly audit 'detect-libc': [ '1.0.3' ],
43 silly audit 'fs-minipass': [ '2.1.0' ],
43 silly audit 'fs.realpath': [ '1.0.0' ],
43 silly audit gauge: [ '2.7.4' ],
43 silly audit glob: [ '7.1.7' ],
43 silly audit 'has-unicode': [ '2.0.1' ],
43 silly audit 'https-proxy-agent': [ '5.0.0' ],
43 silly audit inflight: [ '1.0.6' ],
43 silly audit inherits: [ '2.0.4' ],
43 silly audit 'is-fullwidth-code-point': [ '1.0.0' ],
43 silly audit isarray: [ '1.0.0' ],
43 silly audit 'lru-cache': [ '6.0.0' ],
43 silly audit 'make-dir': [ '3.1.0' ],
43 silly audit semver: [ '6.3.0', '7.3.5' ],
43 silly audit 'mimic-response': [ '2.1.0' ],
43 silly audit minimatch: [ '3.0.4' ],
43 silly audit minipass: [ '3.1.3' ],
43 silly audit minizlib: [ '2.1.2' ],
43 silly audit mkdirp: [ '1.0.4' ],
43 silly audit ms: [ '2.1.2' ],
43 silly audit nan: [ '2.15.0' ],
43 silly audit 'node-fetch': [ '2.6.1' ],
43 silly audit nopt: [ '5.0.0' ],
43 silly audit npmlog: [ '4.1.2' ],
43 silly audit 'number-is-nan': [ '1.0.1' ],
43 silly audit 'object-assign': [ '4.1.1' ],
43 silly audit once: [ '1.4.0' ],
43 silly audit 'path-is-absolute': [ '1.0.1' ],
43 silly audit 'process-nextick-args': [ '2.0.1' ],
43 silly audit 'readable-stream': [ '2.3.7' ],
43 silly audit rimraf: [ '3.0.2' ],
43 silly audit 'safe-buffer': [ '5.1.2' ],
43 silly audit 'set-blocking': [ '2.0.0' ],
43 silly audit 'signal-exit': [ '3.0.3' ],
43 silly audit 'simple-concat': [ '1.0.1' ],
43 silly audit 'simple-get': [ '3.1.0' ],
43 silly audit string_decoder: [ '1.1.1' ],
43 silly audit 'string-width': [ '1.0.2' ],
43 silly audit 'strip-ansi': [ '3.0.1' ],
43 silly audit tar: [ '6.1.11' ],
43 silly audit 'util-deprecate': [ '1.0.2' ],
43 silly audit 'wide-align': [ '1.1.3' ],
43 silly audit wrappy: [ '1.0.2' ],
43 silly audit yallist: [ '4.0.0' ]
43 silly audit }
44 silly tarball no local data for signal-exit#https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz. Extracting by manifest.
45 silly tarball no local data for node-fetch#https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz. Extracting by manifest.
46 silly tarball no local data for minipass#https://registry.npmjs.org/minipass/-/minipass-3.1.3.tgz. Extracting by manifest.
47 silly tarball no local data for debug#https://registry.npmjs.org/debug/-/debug-4.3.2.tgz. Extracting by manifest.
48 silly tarball no local data for canvas#https://registry.npmjs.org/canvas/-/canvas-2.8.0.tgz. Extracting by manifest.
49 silly tarball no local data for are-we-there-yet#https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz. Extracting by manifest.
50 silly tarball no local data for #mapbox/node-pre-gyp#https://registry.npmjs.org/#mapbox/node-pre-gyp/-/node-pre-gyp-1.0.5.tgz. Extracting by manifest.
51 timing reifyNode:node_modules/wrappy Completed in 467ms
52 timing reifyNode:node_modules/wide-align Completed in 468ms
53 timing reifyNode:node_modules/simple-get Completed in 467ms
54 timing reifyNode:node_modules/strip-ansi Completed in 468ms
55 timing reifyNode:node_modules/number-is-nan Completed in 468ms
56 timing reifyNode:node_modules/process-nextick-args Completed in 468ms
57 timing reifyNode:node_modules/string-width Completed in 469ms
58 timing reifyNode:node_modules/path-is-absolute Completed in 468ms
59 timing reifyNode:node_modules/once Completed in 469ms
60 timing reifyNode:node_modules/is-fullwidth-code-point Completed in 468ms
61 timing reifyNode:node_modules/object-assign Completed in 470ms
62 timing reifyNode:node_modules/ms Completed in 469ms
63 timing reifyNode:node_modules/inflight Completed in 469ms
64 timing reifyNode:node_modules/has-unicode Completed in 470ms
65 timing reifyNode:node_modules/code-point-at Completed in 469ms
66 timing reifyNode:node_modules/chownr Completed in 469ms
67 timing reifyNode:node_modules/brace-expansion Completed in 469ms
68 timing reifyNode:node_modules/aproba Completed in 470ms
69 timing reifyNode:node_modules/ansi-regex Completed in 470ms
70 timing reifyNode:node_modules/abbrev Completed in 471ms
71 timing reifyNode:node_modules/lru-cache Completed in 474ms
72 timing reifyNode:node_modules/fs-minipass Completed in 476ms
73 timing reifyNode:node_modules/minimatch Completed in 484ms
74 timing reifyNode:node_modules/set-blocking Completed in 495ms
75 timing reifyNode:node_modules/make-dir Completed in 495ms
76 timing reifyNode:node_modules/inherits Completed in 495ms
77 timing reifyNode:node_modules/mimic-response Completed in 495ms
78 timing reifyNode:node_modules/console-control-strings Completed in 496ms
79 timing reifyNode:node_modules/yallist Completed in 501ms
80 timing reifyNode:node_modules/decompress-response Completed in 497ms
81 timing reifyNode:node_modules/npmlog Completed in 500ms
82 timing reifyNode:node_modules/fs.realpath Completed in 500ms
83 timing reifyNode:node_modules/minizlib Completed in 502ms
84 timing reifyNode:node_modules/safe-buffer Completed in 503ms
85 timing reifyNode:node_modules/string_decoder Completed in 505ms
86 timing reifyNode:node_modules/util-deprecate Completed in 511ms
87 timing reifyNode:node_modules/rimraf Completed in 513ms
88 timing reifyNode:node_modules/balanced-match Completed in 511ms
89 timing reifyNode:node_modules/simple-concat Completed in 514ms
90 timing reifyNode:node_modules/core-util-is Completed in 526ms
91 timing reifyNode:node_modules/nopt Completed in 539ms
92 timing reifyNode:node_modules/detect-libc Completed in 559ms
93 http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/advisories/bulk 1535ms
94 timing auditReport:getReport Completed in 1539ms
95 silly audit report {
95 silly audit report 'node-fetch': [
95 silly audit report {
95 silly audit report id: 1006899,
95 silly audit report url: 'https://github.com/advisories/GHSA-r683-j2x4-v87g',
95 silly audit report title: 'node-fetch is vulnerable to Exposure of Sensitive Information to an Unauthorized Actor',
95 silly audit report severity: 'high',
95 silly audit report vulnerable_versions: '<2.6.7'
95 silly audit report }
95 silly audit report ]
95 silly audit report }
96 timing reifyNode:node_modules/concat-map Completed in 1577ms
97 timing reifyNode:node_modules/isarray Completed in 1580ms
98 timing reifyNode:node_modules/glob Completed in 1740ms
99 timing reifyNode:node_modules/delegates Completed in 1744ms
100 timing reifyNode:node_modules/make-dir/node_modules/semver Completed in 1749ms
101 timing metavuln:cache:get:security-advisory:node-fetch:uaZ3UpetgMoaSFDS6DtQK9+5KXhDQHg9nxPjdRKLpQbF/XdpCvGUNsQpackRFbF2Kj8o/EnjD2og3Lza4bG1eQ== Completed in 386ms
102 http fetch GET 200 https://registry.npmjs.org/minipass/-/minipass-3.1.3.tgz 1928ms (cache miss)
103 timing reifyNode:node_modules/minipass Completed in 2006ms
104 timing reifyNode:node_modules/agent-base Completed in 2021ms
105 timing reifyNode:node_modules/https-proxy-agent Completed in 2024ms
106 timing reifyNode:node_modules/mkdirp Completed in 2027ms
107 http fetch GET 200 https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz 1941ms (cache miss)
108 timing reifyNode:node_modules/are-we-there-yet Completed in 2031ms
109 http fetch GET 200 https://registry.npmjs.org/debug/-/debug-4.3.2.tgz 1957ms (cache miss)
110 timing reifyNode:node_modules/debug Completed in 2040ms
111 http fetch GET 200 https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz 1995ms (cache miss)
112 timing reifyNode:node_modules/signal-exit Completed in 2064ms
113 timing reifyNode:node_modules/gauge Completed in 2125ms
114 http fetch GET 200 https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz 2072ms (cache miss)
115 timing reifyNode:node_modules/node-fetch Completed in 2146ms
116 timing reifyNode:node_modules/readable-stream Completed in 2171ms
117 timing reifyNode:node_modules/tar Completed in 2194ms
118 timing reifyNode:node_modules/semver Completed in 2672ms
119 http fetch GET 200 https://registry.npmjs.org/#mapbox/node-pre-gyp/-/node-pre-gyp-1.0.5.tgz 2596ms (cache miss)
120 timing reifyNode:node_modules/#mapbox/node-pre-gyp Completed in 2692ms
121 timing reifyNode:node_modules/nan Completed in 2783ms
122 http fetch GET 200 https://registry.npmjs.org/canvas/-/canvas-2.8.0.tgz 2721ms (cache miss)
123 timing reifyNode:node_modules/canvas Completed in 2809ms
124 timing reify:unpack Completed in 2814ms
125 timing reify:unretire Completed in 0ms
126 timing build:queue Completed in 11ms
127 timing build:link:node_modules/detect-libc Completed in 29ms
128 timing build:link:node_modules/#mapbox/node-pre-gyp Completed in 30ms
129 timing build:link:node_modules/nopt Completed in 28ms
130 timing build:link:node_modules/mkdirp Completed in 29ms
131 timing build:link:node_modules/semver Completed in 33ms
132 timing build:link:node_modules/make-dir/node_modules/semver Completed in 34ms
133 timing build:link:node_modules/rimraf Completed in 35ms
134 timing build:link Completed in 38ms
135 info run canvas#2.8.0 install node_modules/canvas node-pre-gyp install --fallback-to-build
136 http fetch GET 200 https://registry.npmjs.org/node-fetch 1667ms (cache revalidated)
137 timing metavuln:packument:node-fetch Completed in 1674ms
138 timing metavuln:load:security-advisory:node-fetch:1006899 Completed in 1ms
139 timing metavuln:calculate:security-advisory:node-fetch:1006899 Completed in 1678ms
140 timing metavuln:cache:get:security-advisory:#mapbox/node-pre-gyp:1muVjrCRJhBXDmS0XOk1EPdyjTIUf23qc8/X38z+vDX2yzWRczdDWmpuftGoGK7RxGgzW2yiu6vGNDbuP+2Ixw== Completed in 1ms
141 http fetch GET 200 https://registry.npmjs.org/#mapbox%2fnode-pre-gyp 2333ms (cache revalidated)
142 timing metavuln:packument:#mapbox/node-pre-gyp Completed in 2334ms
143 timing metavuln:load:security-advisory:#mapbox/node-pre-gyp:uaZ3UpetgMoaSFDS6DtQK9+5KXhDQHg9nxPjdRKLpQbF/XdpCvGUNsQpackRFbF2Kj8o/EnjD2og3Lza4bG1eQ== Completed in 6ms
144 timing metavuln:cache:put:security-advisory:#mapbox/node-pre-gyp:1muVjrCRJhBXDmS0XOk1EPdyjTIUf23qc8/X38z+vDX2yzWRczdDWmpuftGoGK7RxGgzW2yiu6vGNDbuP+2Ixw== Completed in 13ms
145 timing metavuln:calculate:security-advisory:#mapbox/node-pre-gyp:uaZ3UpetgMoaSFDS6DtQK9+5KXhDQHg9nxPjdRKLpQbF/XdpCvGUNsQpackRFbF2Kj8o/EnjD2og3Lza4bG1eQ== Completed in 2353ms
146 timing auditReport:init Completed in 4032ms
147 timing reify:audit Completed in 5572ms
148 info run canvas#2.8.0 install { code: 1, signal: null }
149 timing reify:rollback:createSparse Completed in 122ms
150 timing reify:rollback:retireShallow Completed in 0ms
151 timing command:install Completed in 6718ms
152 verbose stack Error: command failed
152 verbose stack at ChildProcess.<anonymous> (C:\Users\A7\AppData\Roaming\npm\node_modules\npm\node_modules\#npmcli\promise-spawn\index.js:64:27)
152 verbose stack at ChildProcess.emit (node:events:390:28)
152 verbose stack at maybeClose (node:internal/child_process:1064:16)
152 verbose stack at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
153 verbose pkgid canvas#2.8.0
154 verbose cwd C:\Users\A7\Desktop\generative-art-node-main
155 verbose Windows_NT 10.0.19043
156 verbose argv "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Users\\A7\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
157 verbose node v16.13.2
158 verbose npm v8.3.2
159 error code 1
160 error path C:\Users\A7\Desktop\generative-art-node-main\node_modules\canvas
161 error command failed
162 error command C:\WINDOWS\system32\cmd.exe /d /s /c node-pre-gyp install --fallback-to-build
163 error Failed to execute 'C:\Program Files (x86)\nodejs\node.exe C:\Users\A7\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\A7\Desktop\generative-art-node-main\node_modules\canvas\build\Release\canvas.node --module_name=canvas --module_path=C:\Users\A7\Desktop\generative-art-node-main\node_modules\canvas\build\Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93 --python=/path/to/executable/python --msvs_version=2017' (1)
164 error node-pre-gyp info it worked if it ends with ok
164 error node-pre-gyp info using node-pre-gyp#1.0.5
164 error node-pre-gyp info using node#16.13.2 | win32 | ia32
164 error node-pre-gyp info check checked for "C:\Users\A7\Desktop\generative-art-node-main\node_modules\canvas\build\Release\canvas.node" (not found)
164 error node-pre-gyp http GET https://github.com/Automattic/node-canvas/releases/download/v2.8.0/canvas-v2.8.0-node-v93-win32-unknown-ia32.tar.gz
164 error node-pre-gyp ERR! install response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.8.0/canvas-v2.8.0-node-v93-win32-unknown-ia32.tar.gz
164 error node-pre-gyp WARN Pre-built binaries not installable for canvas#2.8.0 and node#16.13.2 (node-v93 ABI, unknown) (falling back to source compile with node-gyp)
164 error node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.8.0/canvas-v2.8.0-node-v93-win32-unknown-ia32.tar.gz
164 error gyp info it worked if it ends with ok
164 error gyp info using node-gyp#8.4.1
164 error gyp info using node#16.13.2 | win32 | ia32
164 error gyp info ok
164 error gyp info it worked if it ends with ok
164 error gyp info using node-gyp#8.4.1
164 error gyp info using node#16.13.2 | win32 | ia32
164 error gyp info find Python using Python version 3.10.2 found at "C:\Python310\python.exe"
164 error gyp ERR! find VS
164 error gyp ERR! find VS msvs_version was set from command line or npm config
164 error gyp ERR! find VS - looking for Visual Studio version 2017
164 error gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
164 error gyp ERR! find VS checking VS2019 (16.11.32106.194) found at:
164 error gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools"
164 error gyp ERR! find VS - found "Visual Studio C++ core features"
164 error gyp ERR! find VS - found VC++ toolset: v142
164 error gyp ERR! find VS - found Windows SDK: 10.0.19041.0
164 error gyp ERR! find VS - msvs_version does not match this version
164 error gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use
164 error gyp ERR! find VS looking for Visual Studio 2015
164 error gyp ERR! find VS - not found
164 error gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
164 error gyp ERR! find VS
164 error gyp ERR! find VS valid versions for msvs_version:
164 error gyp ERR! find VS - "2019"
164 error gyp ERR! find VS - "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools"
164 error gyp ERR! find VS
164 error gyp ERR! find VS **************************************************************
164 error gyp ERR! find VS You need to install the latest version of Visual Studio
164 error gyp ERR! find VS including the "Desktop development with C++" workload.
164 error gyp ERR! find VS For more information consult the documentation at:
164 error gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
164 error gyp ERR! find VS **************************************************************
164 error gyp ERR! find VS
164 error gyp ERR! configure error
164 error gyp ERR! stack Error: Could not find any Visual Studio installation to use
164 error gyp ERR! stack at VisualStudioFinder.fail (C:\Users\A7\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:122:47)
164 error gyp ERR! stack at C:\Users\A7\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:75:16
164 error gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (C:\Users\A7\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:363:14)
164 error gyp ERR! stack at C:\Users\A7\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:71:14
164 error gyp ERR! stack at C:\Users\A7\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:384:16
164 error gyp ERR! stack at C:\Users\A7\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7
164 error gyp ERR! stack at C:\Users\A7\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16
164 error gyp ERR! stack at ChildProcess.exithandler (node:child_process:404:5)
164 error gyp ERR! stack at ChildProcess.emit (node:events:390:28)
164 error gyp ERR! stack at maybeClose (node:internal/child_process:1064:16)
164 error gyp ERR! System Windows_NT 10.0.19043
164 error gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Users\\A7\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\\Users\\A7\\Desktop\\generative-art-node-main\\node_modules\\canvas\\build\\Release\\canvas.node" "--module_name=canvas" "--module_path=C:\\Users\\A7\\Desktop\\generative-art-node-main\\node_modules\\canvas\\build\\Release" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v93" "--python=/path/to/executable/python" "--msvs_version=2017"
164 error gyp ERR! cwd C:\Users\A7\Desktop\generative-art-node-main\node_modules\canvas
164 error gyp ERR! node -v v16.13.2
164 error gyp ERR! node-gyp -v v8.4.1
164 error gyp ERR! not ok
164 error node-pre-gyp ERR! build error
164 error node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files (x86)\nodejs\node.exe C:\Users\A7\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\A7\Desktop\generative-art-node-main\node_modules\canvas\build\Release\canvas.node --module_name=canvas --module_path=C:\Users\A7\Desktop\generative-art-node-main\node_modules\canvas\build\Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93 --python=/path/to/executable/python --msvs_version=2017' (1)
164 error node-pre-gyp ERR! stack at ChildProcess.<anonymous> (C:\Users\A7\Desktop\generative-art-node-main\node_modules\#mapbox\node-pre-gyp\lib\util\compile.js:89:23)
164 error node-pre-gyp ERR! stack at ChildProcess.emit (node:events:390:28)
164 error node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1064:16)
164 error node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
164 error node-pre-gyp ERR! System Windows_NT 10.0.19043
164 error node-pre-gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Users\\A7\\Desktop\\generative-art-node-main\\node_modules\\#mapbox\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
164 error node-pre-gyp ERR! cwd C:\Users\A7\Desktop\generative-art-node-main\node_modules\canvas
164 error node-pre-gyp ERR! node -v v16.13.2
164 error node-pre-gyp ERR! node-pre-gyp -v v1.0.5
164 error node-pre-gyp ERR! not ok
165 verbose exit 1
166 timing npm Completed in 7222ms
167 verbose unfinished npm timer reify 1642963852180
168 verbose unfinished npm timer reify:build 1642963855129
169 verbose unfinished npm timer build 1642963855130
170 verbose unfinished npm timer build:deps 1642963855130
171 verbose unfinished npm timer build:run:install 1642963855180
172 verbose unfinished npm timer build:run:install:node_modules/canvas 1642963855180
173 verbose code 1
174 error A complete log of this run can be found in:
174 error C:\Users\A7\AppData\Local\npm-cache\_logs\2022-01-23T18_50_51_726Z-debug-0.log
I spent 3 days trying to figure out what is the problem. I installed GTK in C:\GTK. I installed libjpeg-turbo-gcc64 in same path,i made sure everything is up to date the below is npm doctor
npm WARN verifyCachedFiles Content garbage-collected: 1 (7633 bytes)
npm WARN verifyCachedFiles Cache issues have been fixed
Check Value Recommendation/Notes
npm ping ok
npm -v ok current: v8.3.2, latest: v8.3.2
node -v ok current: v16.13.2, recommended: v16.13.2
npm config get registry ok using default registry (https://registry.npmjs.org/)
which git ok C:\Program Files (x86)\Git\cmd\git.EXE
Verify cache contents ok verified 3144 tarballs
and made sure everything is good in PATH as below
C:\Program Files (x86)\nodejs
C:\Users\A7\AppData\Roaming\npm
C:\Program Files (x86)\Git\cmd
C:\Program Files (x86)\Git\Git\bin\git.exe
C:\GTK\bin
and I installed node-gyp and this is the version I ran C:\Users\A7>node-gyp -v this is the results v8.4.1
I notice when I ran npm install that it installed node_modules and inside also the canvas, but an error pops up, and with the error abortion deletes node_modules folder with its contents.
I need someone to head me in the right direction because I am lost and this is my first time with nodejs. I tried every possible solution with no luck, to the point I thought my problem is original and I believe not.

Having problem installing sqlite3#5.0.2 on NodeJS

I am trying to install the most recent version of sqlite3 module to make tests of my database models. Note that I am using Ubuntu 21.04. But I am getting this error. Here is the log:
519 info run sqlite3#5.0.2 install node_modules/sqlite3 node-pre-gyp install --fallback-to-build
520 info run sqlite3#5.0.2 install { code: 1, signal: null }
521 http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/advisories/bulk 496ms
522 timing auditReport:getReport Completed in 498ms
523 timing auditReport:init Completed in 0ms
524 timing reify:audit Completed in 499ms
525 timing reify:rollback:createSparse Completed in 86ms
526 timing reify:rollback:retireShallow Completed in 0ms
527 timing command:install Completed in 2791ms
528 verbose stack Error: command failed
528 verbose stack at ChildProcess.(/usr/local/lib/node_modules/npm/node_modules/#npmcli/promise-spawn/index.js:64:27)
528 verbose stack at ChildProcess.emit (events.js:315:20)
528 verbose stack at maybeClose (internal/child_process.js:1048:16)
528 verbose stack at Socket. (internal/child_process.js:439:11)
528 verbose stack at Socket.emit (events.js:315:20)
528 verbose stack at Pipe. (net.js:673:12)
529 verbose pkgid sqlite3#5.0.2
530 verbose cwd /home/diesanromero/Code/platzi/platziverse/platsiverse-db
531 verbose Linux 5.11.0-16-generic
532 verbose argv "/snap/node/4150/bin/node" "/usr/local/bin/npm" "i" "--save-dev" "sqlite3"
533 verbose node v14.16.1
534 verbose npm v7.11.2
535 error code 1
536 error path /home/diesanromero/Code/platzi/platziverse/platsiverse-db/node_modules/sqlite3
537 error command failed
538 error command sh -c node-pre-gyp install --fallback-to-build
539 verbose exit 1
From what I see this is an error generated by node-pre-gyp. I am using the latest version of NPM and NodeJS. I have tried other versions of SQLite3 like 4.1.1 or 5.0.0, but I am getting the same error. I reinstalled node-pre-gyp globally, and nothing happened. I already clean the npm cache, etc.
Anyone has an Idea what is going on?

Resources