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

191
Visualizações
How do I clear npm errors and get my port to run?

I'm trying to learn how to create an API, and I keep getting errors while trying to run npm run start.

{
  "name": "climate-change-api",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "start":"nodemon index.js"
  },
  "author": "Norbert Ogutu",
  "license": "ISC",
  "dependencies": {
    "axios": "^0.23.0",
    "cheerio": "^1.0.0-rc.10",
    "express": "^4.17.1"
  }
}

index.js

const PORT = 8000
const express = require('express')
const axios = require('axios').default
const cheerio = require('cheerio')

const app = express()

app.listen(PORT,() => console.log(`server running on PORT ${PORT}`))

And these are the errors:

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! climate-change-api@1.0.0 start: `nodemon index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the climate-change-api@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\THE OGUTUS\AppData\Roaming\npm-cache\_logs\2021-10-15T16_37_45_680Z-debug.log
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Since the referenced index.html isn't doing much except referencing installed libraries ... and you do have those libraries listed as dependencies ... I wonder if perhaps you forgot to run npm install (npm i for short) to install those dependencies?

Alternatively, since you failed to include Nodemon in your dependencies, did you perhaps forget to npm i nodemon?

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