Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

109
Vistas
npm faker issue in angular

In angular project I am creating two files to generate fake data.

File structure as below https://i.stack.imgur.com/UBSFQ.png

Writing generate.js to create data into database.json

And creating command in package.json as below. https://i.stack.imgur.com/hIj6t.png

But am getting errors while running code as "npm run generate" https://i.stack.imgur.com/70c2M.png

FYI : I tried deleting node modules and regerating them but not able to get solution


var database = { products: []};

for (var i = 1; i<= 300; i++) {
  database.products.push({
    id: i,
    name: faker.commerce.productName(),
    description: faker.lorem.sentences(),
    price: faker.commerce.price(),
    imageUrl: "https://source.unsplash.com/1600x900/?product",
    quantity: faker.random.number()
  });
}

console.log(JSON.stringify(database)); ```
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

if you are using faker@6.6.6 latest version then it's not going to be work because developer closed this project with last commit of endgame but if you want to use fakerjs then downgrade your package by faker@5.5.3 then its going to work like

npm i faker@5.5.3
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda