npm install fails as node-gyp is unable to build lmdb

See original GitHub issue

🐛 bug report

When trying to install parcel into npm project, npm install --save-dev parcel fails with exit code 7, complaining about node-gyp failing to build lmdb package.

🎛 Log

$ npm install --save-dev parcel
npm ERR! code 7
npm ERR! path /tmp/parcel-bug/node_modules/lmdb
npm ERR! command failed
npm ERR! command sh -c node-gyp-build-optional-packages
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@18.2.0 | linux | x64
npm ERR! gyp info find Python using Python version 3.10.4 found at "/usr/bin/python3"
npm ERR! gyp ERR! UNCAUGHT EXCEPTION 
npm ERR! gyp ERR! stack Error: Cannot find module 'request'
npm ERR! gyp ERR! stack Require stack:
npm ERR! gyp ERR! stack - /usr/lib/node_modules/npm/node_modules/node-gyp/lib/install.js
npm ERR! gyp ERR! stack - /usr/lib/node_modules/npm/node_modules/node-gyp/lib/node-gyp.js
npm ERR! gyp ERR! stack - /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js
npm ERR! gyp ERR! stack     at Module._resolveFilename (node:internal/modules/cjs/loader:939:15)
npm ERR! gyp ERR! stack     at Module._load (node:internal/modules/cjs/loader:780:27)
npm ERR! gyp ERR! stack     at Module.require (node:internal/modules/cjs/loader:1005:19)
npm ERR! gyp ERR! stack     at require (node:internal/modules/cjs/helpers:102:18)
npm ERR! gyp ERR! stack     at Object.<anonymous> (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/install.js:10:17)
npm ERR! gyp ERR! stack     at Module._compile (node:internal/modules/cjs/loader:1105:14)
npm ERR! gyp ERR! stack     at Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
npm ERR! gyp ERR! stack     at Module.load (node:internal/modules/cjs/loader:981:32)
npm ERR! gyp ERR! stack     at Module._load (node:internal/modules/cjs/loader:827:12)
npm ERR! gyp ERR! stack     at Module.require (node:internal/modules/cjs/loader:1005:19)
npm ERR! gyp ERR! System Linux 5.17.9-arch1-1
npm ERR! gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /tmp/parcel-bug/node_modules/lmdb
npm ERR! gyp ERR! node -v v18.2.0
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! Node-gyp failed to build your package.
npm ERR! gyp ERR! Try to update npm and/or node-gyp and if it does not help file an issue with the package author.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/myawesomeusername/.npm/_logs/2022-05-27T10_20_36_304Z-debug-0.log

🌍 Your Environment

Software Version(s)
Node v18.2.0
npm 8.5.5
Operating System Arch Linux / x64

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:4
  • Comments:29 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
kriszypcommented, Jul 11, 2022

@srishilesh msgpackr-extract is not a (required) dependency of gatsby. Or parcel. Or lmdb-js. Or msgpackr. So if you have not explicitly added msgpackr-extract as a dependency in your package.json, this should just be logging noise, not a real failure. Also, this is because node.js v10 is not a supported version of node (according to node.js themselves, and generally unsafe to use due to a lack of security patches).

2reactions
kriszypcommented, May 29, 2022

Ok, trying again with 4.3.5, hopefully the carriage returns are gone now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't install parceljs - node.js - Stack Overflow
I was trying to run npm i --save-dev parcel and got this error below. ... node-gyp-build npm ERR! gyp info it worked if...
Read more >
Debugging "Make Failed with Exit Code 2" Error - CodeForGeek
The “Make Failed with Exit Code 2” error occurs during the node modules installation. We see lots of stack trace including the one...
Read more >
Npm install command failing with message "could not find ...
When I run the npm install command, npm starts downloading the dependencies. But then, suddenly, it stops with the error:
Read more >
lmdb-store - npm
Start using lmdb-store in your project by running `npm i lmdb-store`. There are 7 other projects in the npm registry using lmdb-store.
Read more >
Deploy error on Netlify CMS Gatsby site (exit code 1: npm run ...
Error Command failed with exit code 1: npm run build netlify site name ... PM: > node-gyp-build-optional-packages 3:14:57 PM: > lmdb-store@1.6.14 install ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found