Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

546
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda