0

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.

  • Did you set up your environment variables? – Ankit Nov 16 '22 at 02:22
  • Looks like a dependancy of one of the modules you're trying to install doesn't exist - maybe the publisher deleted the version of `ls-trace` that `platform-tracer` references? Try installing a different version of that module, maybe the latest - or modify the dependancy version number in the package.json of whatever you are trying to do npm install for? Whats the output if you type `node -v` and `npm --version` – Noscere Nov 16 '22 at 02:24
  • Node Version: 19.0.1 NPM version: 9.1.1 currently. I am unable to install any npm packages inside this repo. If I simply run `npm install express` then also I am getting this error. I also removed the platform-tracer package and tried again but the error still same. Then I thought it may be some cache but clean cache command is not working but I tried `npm cache verify` but no such results. I am using new Mac M1 with Arm processor, is that causing issue here? @Ankit for running npm install? – Mohammad Arshad Nov 16 '22 at 03:35
  • Please refer this link, https://stackoverflow.com/questions/17990647/npm-install-errors-with-error-enoent-chmod – tamilselvancst Nov 16 '22 at 05:32
  • have you tried the Latest LTS Version 18.12.1? it is recommended for most users, your node version seems Latest Current Version. it might have some existing open issues. you can also try yarn instead of npm. – shubham jha Nov 16 '22 at 17:00
  • No it doesn't work with 18.12.1 – Mohammad Arshad Nov 18 '22 at 19:23

2 Answers2

0

Looks like you have dependency conflicts, try this command.

npm install --legacy-peer-deps
0

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

> ls-trace@0.2.1 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

> pprof@3.2.0 install /Users/node_modules/pprof
> node-pre-gyp install --fallback-to-build