Having problem installing sqlite3#5.0.2 on NodeJS - node.js

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?

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

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

npm install error ( npm install -g angular-cli ) in windows 10 64 bit

While installing angular on my machine I am getting the below error. Uninstall and installed Node multiple times. But it is not helping. I have given the error log below. Can anyone help me in sorting this?
3 silly resolveWithNewModule universal-analytics#0.4.20 checking installable status
324 silly pacote version manifest for uuid#7.0.2 fetched in 298ms
325 silly resolveWithNewModule uuid#7.0.2 checking installable status
326 timing stage:rollbackFailedOptional Completed in 2ms
327 timing stage:runTopLevelLifecycles Completed in 9824ms
328 verbose stack Error: UNKNOWN: unknown error, open 'C:\Users\Shally.BBYBSDC\AppData\Roaming\npm-cache\_cacache\index-v5\1f\85\3e0b21cc5deb10a0dc51ed6dace9f5ae0f08f66b5c064b262517165cfa2f'
329 verbose cwd C:\Users\Shally.BBYBSDC
330 verbose Windows_NT 10.0.18362
331 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "#angular/cli"
332 verbose node v14.4.0
333 verbose npm v6.14.5
334 error code UNKNOWN
335 error syscall open
336 error path C:\Users\Shally.BBYBSDC\AppData\Roaming\npm-cache\_cacache\index-v5\1f\85\3e0b21cc5deb10a0dc51ed6dace9f5ae0f08f66b5c064b262517165cfa2f
337 error errno -4094
338 error UNKNOWN: unknown error, open 'C:\Users\Shally.BBYBSDC\AppData\Roaming\npm-cache\_cacache\index-v5\1f\85\3e0b21cc5deb10a0dc51ed6dace9f5ae0f08f66b5c064b262517165cfa2f'
339 verbose exit [ -4094, true ]

Amplify cli : npm ERR! Maximum call stack size exceeded

On executing
npm install -g #aws-amplify/cli
It results in
npm ERR! Maximum call stack size exceeded
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Nashif Alam\AppData\Roaming\npm-cache\_logs\2020-04-20T17_44_57_963Z-debug.log
Here is the Log output
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Users\\Nashif Alam\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install',
1 verbose cli '-g',
1 verbose cli '#aws-amplify/cli'
1 verbose cli ]
2 info using npm#6.14.4
3 info using node#v12.16.2
4 verbose npm-session 48145273415ef01a
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 http fetch GET 304 https://registry.npmjs.org/#aws-amplify%2fcli 6012ms (from cache)
8 silly pacote tag manifest for #aws-amplify/cli#latest fetched in 6185ms
9 timing stage:loadCurrentTree Completed in 6274ms
//Removed the rest of the log because it seemed useless in this context
916 silly resolveWithNewModule param-case#3.0.3 checking installable status
917 silly pacote version manifest for upper-case#2.0.1 fetched in 8ms
918 silly resolveWithNewModule upper-case#2.0.1 checking installable status
919 http fetch GET 200 https://registry.npmjs.org/#ardatan%2fgraphql-tools 1713ms
920 http fetch GET 200 https://registry.npmjs.org/#ardatan/graphql-tools/-/graphql-tools-4.1.0.tgz 5735ms
921 silly pacote version manifest for #ardatan/graphql-tools#4.1.0 fetched in 7453ms
922 silly resolveWithNewModule #ardatan/graphql-tools#4.1.0 checking installable status
923 silly pacote range manifest for dot-case#^3.0.3 fetched in 2ms
924 silly resolveWithNewModule dot-case#3.0.3 checking installable status
925 silly pacote version manifest for #graphql-toolkit/common#0.9.7 fetched in 5ms
926 silly resolveWithNewModule #graphql-toolkit/common#0.9.7 checking installable status
927 silly fetchPackageMetaData error for relay-compiler#8.0.0 Response timeout while trying to fetch https://registry.npmjs.org/relay-compiler (over 30000ms)
928 verbose stack RangeError: Maximum call stack size exceeded
928 verbose stack at RegExp.test (<anonymous>)
928 verbose stack at isDepOptional (C:\Users\Nashif Alam\AppData\Roaming\npm\node_modules\npm\lib\install\deps.js:428:45)
928 verbose stack at failedDependency (C:\Users\Nashif Alam\AppData\Roaming\npm\node_modules\npm\lib\install\deps.js:437:9)
928 verbose stack at failedDependency (C:\Users\Nashif Alam\AppData\Roaming\npm\node_modules\npm\lib\install\deps.js:453:9)
928 verbose stack at failedDependency (C:\Users\Nashif Alam\AppData\Roaming\npm\node_modules\npm\lib\install\deps.js:453:9)
928 verbose stack at failedDependency (C:\Users\Nashif Alam\AppData\Roaming\npm\node_modules\npm\lib\install\deps.js:453:9)
928 verbose stack at failedDependency (C:\Users\Nashif Alam\AppData\Roaming\npm\node_modules\npm\lib\install\deps.js:453:9)
928 verbose stack at failedDependency (C:\Users\Nashif Alam\AppData\Roaming\npm\node_modules\npm\lib\install\deps.js:453:9)
928 verbose stack at failedDependency (C:\Users\Nashif Alam\AppData\Roaming\npm\node_modules\npm\lib\install\deps.js:453:9)
928 verbose stack at failedDependency (C:\Users\Nashif Alam\AppData\Roaming\npm\node_modules\npm\lib\install\deps.js:453:9)
928 verbose stack at failedDependency (C:\Users\Nashif Alam\AppData\Roaming\npm\node_modules\npm\lib\install\deps.js:453:9)
928 verbose stack at failedDependency (C:\Users\Nashif Alam\AppData\Roaming\npm\node_modules\npm\lib\install\deps.js:453:9)
928 verbose stack at failedDependency (C:\Users\Nashif Alam\AppData\Roaming\npm\node_modules\npm\lib\install\deps.js:453:9)
928 verbose stack at failedDependency (C:\Users\Nashif Alam\AppData\Roaming\npm\node_modules\npm\lib\install\deps.js:453:9)
928 verbose stack at failedDependency (C:\Users\Nashif Alam\AppData\Roaming\npm\node_modules\npm\lib\install\deps.js:453:9)
928 verbose stack at failedDependency (C:\Users\Nashif Alam\AppData\Roaming\npm\node_modules\npm\lib\install\deps.js:453:9)
929 verbose cwd C:\Users\Nashif Alam
930 verbose Windows_NT 10.0.18363
931 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Nashif Alam\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "#aws-amplify/cli"
932 verbose node v12.16.2
933 verbose npm v6.14.4
934 error Maximum call stack size exceeded
935 verbose exit [ 1, true ]
npm version is 6.14.4
and node version is v12.16.2
I tried installing node 10, still same errors
Moreover, every time the log is mostly stuck in Response timeout while trying to fetch https://registry.npmjs.org/**Different link everytime**
Using the following command worked for me
npm cache clean --force
I figured out an answer to the problem, which probably lies with Nodejs version 12.16 and many other earlier versions like 5.0 and 10; But using version 13.13 solved the problem and the command run with no issues.
For me the log looked like this:
// ... skipping some deprecation warnings
> core-js#3.6.5 postinstall /root/.nvm/versions/node/v14.10.0/lib/node_modules/#aws-amplify/cli/node_modules/amplify-graphql-types-generator/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"
sh: 1: node: Permission denied
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#~2.1.2 (node_modules/#aws-amplify/cli/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! Maximum call stack size exceeded
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-09-10T14_10_28_397Z-debug.log
Note sh: 1: node: Permission denied that led me to https://forum.vuejs.org/t/cannot-install-vue-cli-permission-error-in-require-postinstall/82017/7
I had to add --unsafe-perm to the install command and run it as root (I was already root in WSL):
npm install -g --unsafe-perm #aws-amplify/cli

create-react-app is not working?

I am a regular react user and usually use create-react-app but from this morning it is not working.
I have checked the npm, it is installed and fine. I have checked that create-react-app is globally installed on my system. The error is coming with some JSON file.
Versions installed on my system:
node -v
v9.0.0
$ npm -v
5.5.1
I have attached the log file below, I'm attaching log file from where the error comes first:
917 http fetch GET 200 https://registry.npmjs.org/babel-plugin-transform-es2015-unicode-regex 19ms (from cache)
918 silly fetchPackageMetaData error for babel-plugin-transform-es2015-unicode-regex#^6.22.0 Unexpected end of JSON input while parsing near '....7":{"name":"babel-pl'
919 silly pacote range manifest for babel-plugin-transform-es2015-sticky-regex#^6.22.0 fetched in 25ms
920 silly resolveWithNewModule babel-plugin-transform-es2015-sticky-regex#6.24.1 checking installable status
921 silly pacote range manifest for babel-plugin-transform-es2015-template-literals#^6.22.0 fetched in 24ms
922 silly resolveWithNewModule babel-plugin-transform-es2015-template-literals#6.22.0 checking installable status
923 silly pacote range manifest for babel-plugin-transform-exponentiation-operator#^6.22.0 fetched in 23ms
924 silly resolveWithNewModule babel-plugin-transform-exponentiation-operator#6.24.1 checking installable status
925 silly pacote range manifest for babel-plugin-transform-es2015-typeof-symbol#^6.23.0 fetched in 24ms
926 silly resolveWithNewModule babel-plugin-transform-es2015-typeof-symbol#6.23.0 checking installable status
927 verbose stack SyntaxError: Unexpected end of JSON input while parsing near '....7":{"name":"babel-pl'
927 verbose stack at JSON.parse (<anonymous>)
927 verbose stack at parseJson (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\node-fetch-npm\node_modules\json-parse-better-errors\index.js:7:17)
927 verbose stack at consumeBody.call.then.buffer (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\node-fetch-npm\src\body.js:96:50)
927 verbose stack at <anonymous>
927 verbose stack at process._tickCallback (internal/process/next_tick.js:188:7)
928 verbose cwd C:\Users\ashve\Desktop\Startup\startup
929 verbose Windows_NT 10.0.17134
930 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--save" "--save-exact" "--loglevel" "error" "react" "react-dom" "react-scripts"
931 verbose node v9.0.0
932 verbose npm v5.5.1
933 error Unexpected end of JSON input while parsing near '....7":{"name":"babel-pl'
934 verbose exit [ 1, true ]
I saw you're using Windows. Try to clean the cache.
npm cache clean --force
or
Goto %appdata%\npm-cache and check if the directory is clean or not. If not, delete all file from the directory manually.
Now try create-react-app yourAppName

Resources