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

116
Views
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 answers
Answer question

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 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!