Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

545
Views
node cannot find globally installed npm module

node (18.7.0) cannot find globally installed npm (8.18.0) module.

My app.js includes:

let jp = require('jsonpath')

Command lines & outputs:

$ npm install -g jsonpath
…

$ npm -g list
/usr/local/lib
├── @aws-amplify/cli@9.2.1
├── jsonpath@1.1.1
└── npm@8.18.0

$ node app.js                  

node:internal/modules/cjs/loader:959
  throw err;
  ^

Error: Cannot find module 'jsonpath'
Require stack:
- /Users/user/Code/project/js/app.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:956:15)
    at Module._load (node:internal/modules/cjs/loader:804:27)
    at Module.require (node:internal/modules/cjs/loader:1022:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/Users/user/Code/project/js/app.js:1:10)
    at Module._compile (node:internal/modules/cjs/loader:1120:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1174:10)
    at Module.load (node:internal/modules/cjs/loader:998:32)
    at Module._load (node:internal/modules/cjs/loader:839:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/user/Code/project/js/app.js'
  ]
}

Node.js v18.7.0
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Yes, this won't work! Because your app.js will use jsonpath in current project node_modules, not the one you installed globally. You have to install library in current project, just simply run:

npm install jsonpath

Then it will work properly!

about 4 years ago · Juan Pablo Isaza Report

0

Hi yes As a friend said open terminal in your path project and type

npm i jsonpath
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!