How to build an Angular 8 app from scratch in 11 easy steps

when i get to step 7, and i run npm run generate i get this:

Error: Cannot find module ‘\node_modules\faker\index.js’.
Please verify that the package.json has a valid “main” entry

in the faker folder id not see a file called index.js

path: ‘\RestApiApp\node_modules\faker\package.json’,
requestPath: ‘faker’

Probably because faker.js is gone bro…

See the above video for some background on the maintainer, and understand fakerjs/faker is basically an abandoned project that will need to be replaced with forks.

However as a workaround to the fact the latest version for faker 6.6.6, is 100% broken, is to install the previous version of 5.5.3.

You can do this with

npm install --save-dev faker@5.5.3

I’d consider this somewhat risky however, as again the library isn’t abandoned, it’s be sabotaged by its creator so use at your own risk.

I’d also consider following a different tutorial all together. Angular 8 is an older version and no longer supported. The latest version is Angular 13.

Don’t worry much about the versions, as they increment often and there have been minimal major changes. You will probably have no problem following an Angular 8 tutorial as you would a newer one, as the API surface is more or less the same. At the same time there are a few differences and the last thing you’d want to do is learn “legacy” out of the gate.

Further reading: