Home > Software engineering >  npm install command failed
npm install command failed

Time:11-19

I am running npm install commands and it is failing with error:

npm ERR! code 1
npm ERR! path /Users/alex/Documents/serviceName/node_modules/platform-tracer/node_modules/ls-trace
npm ERR! command failed
npm ERR! command sh -c node scripts/post_install.js
npm ERR! Extracting prebuilt binaries.
npm ERR! Extraction of prebuilt binaries failed.
npm ERR! node:internal/process/promises:289
npm ERR!             triggerUncaughtException(err, true /* fromPromise */);
npm ERR!             ^
npm ERR! 
npm ERR! [Error: ENOENT: no such file or directory, stat 'prebuilds.tgz'] {
npm ERR!   errno: -2,
npm ERR!   code: 'ENOENT',
npm ERR!   syscall: 'stat',
npm ERR!   path: 'prebuilds.tgz'
npm ERR! }
npm ERR! 
npm ERR! Node.js v19.0.1

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/alex/.npm/_logs/2022-11-16T02_01_25_429Z-debug-0.log

I tried many things like uninstall the node and npm packages and then again reinstall them. And also tried npm cache verify.

I just want to install npm packages.

Node Version: 19.0.1 NPM version: 9.1.1

I tried on previous versions also but it doesn't work so updated to the latest but results are same.

CodePudding user response:

Looks like you have dependency conflicts, try this command.

npm install --legacy-peer-deps

CodePudding user response:

So, it runs on version 14.20.0 the following module may be available/support on that version only.

Module logs which was causing error before

> [email protected] install /Users/config-service/node_modules/ls-trace
> node scripts/post_install.js

Extracting prebuilt binaries.
Extraction of prebuilt binaries failed.
Trying to compile new binaries.
  CXX(target) Release/obj.target/metrics/packages/dd-trace/src/native/metrics/Collector.o
  CXX(target) Release/obj.target/metrics/packages/dd-trace/src/native/metrics/EventLoop.o
  CXX(target) Release/obj.target/metrics/packages/dd-trace/src/native/metrics/GarbageCollection.o
  CXX(target) Release/obj.target/metrics/packages/dd-trace/src/native/metrics/Heap.o
  CXX(target) Release/obj.target/metrics/packages/dd-trace/src/native/metrics/Histogram.o
  CXX(target) Release/obj.target/metrics/packages/dd-trace/src/native/metrics/Object.o
  CXX(target) Release/obj.target/metrics/packages/dd-trace/src/native/metrics/Process.o
  CXX(target) Release/obj.target/metrics/packages/dd-trace/src/native/metrics/SpanTracker.o
  CXX(target) Release/obj.target/metrics/packages/dd-trace/src/native/metrics/utils.o
  CXX(target) Release/obj.target/metrics/packages/dd-trace/src/native/metrics/main.o
  SOLINK_MODULE(target) Release/metrics.node

> [email protected] install /Users/node_modules/pprof
> node-pre-gyp install --fallback-to-build
  • Related