Solucionado (ver solução)
Solucionado
(ver solução)
1
resposta

Erro ao executar npm start

Prezados, bom dia!

Venho tendo esse problema ao executar o comando "npm start", já removi a pasta node_modules e o package-lock.json e rodei o "npm install" porém continua acontecendo, versão do node é a 10.19.0.

> casadocodigo@1.0.0 start /var/www/html/Github/Node.js-Parte-2
> nodemon server.js --ignore *.marko.js

[nodemon] 1.18.4
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `node server.js`
internal/modules/cjs/loader.js:983
  throw err;
  ^

Error: Cannot find module '/var/www/html/Github/Node.js-Parte-2/node_modules/sqlite3/lib/binding/node-v79-linux-x64/node_sqlite3.node'
Require stack:
- /var/www/html/Github/Node.js-Parte-2/node_modules/sqlite3/lib/sqlite3.js
- /var/www/html/Github/Node.js-Parte-2/src/config/database.js
- /var/www/html/Github/Node.js-Parte-2/src/app/rotas/rotas.js
- /var/www/html/Github/Node.js-Parte-2/src/config/custom-express.js
- /var/www/html/Github/Node.js-Parte-2/server.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:980:15)
    at Function.Module._load (internal/modules/cjs/loader.js:862:27)
    at Module.require (internal/modules/cjs/loader.js:1040:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/var/www/html/Github/Node.js-Parte-2/node_modules/sqlite3/lib/sqlite3.js:4:15)
    at Module._compile (internal/modules/cjs/loader.js:1151:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1171:10)
    at Module.load (internal/modules/cjs/loader.js:1000:32)
    at Function.Module._load (internal/modules/cjs/loader.js:899:14)
    at Module.require (internal/modules/cjs/loader.js:1040:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/var/www/html/Github/Node.js-Parte-2/node_modules/sqlite3/lib/sqlite3.js',
    '/var/www/html/Github/Node.js-Parte-2/src/config/database.js',
    '/var/www/html/Github/Node.js-Parte-2/src/app/rotas/rotas.js',
    '/var/www/html/Github/Node.js-Parte-2/src/config/custom-express.js',
    '/var/www/html/Github/Node.js-Parte-2/server.js'
  ]
}
[nodemon] app crashed - waiting for file changes before starting...
1 resposta
solução!

Olá Luan, tudo bem com você?

Normalmente esse problema é com a versão do sqlite3 e as dependências do mesmo pacote

Após remover o package-lock.json você poderia seguir alguns passos?

  • Dentro do package.json delete a linha do sqlite3
  • Rode npm install sqlite3
  • Agora sim utilize o npm install
  • Tente rodar o servidor com npm start

Abraços e Bons Estudos!

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software