If you haven't developed PCF components for a while but have been keeping the CLI (command line interface) up-to-date regularly by calling "pac install latest", it's possible to encounter strange errors when you attempt to call the npm commands, such as "npm install" or "npm run build".
The most likely cause of this problem is that the version of Node and NPM on
your machine is out of date. You can check the version of Node and NPM on your machine by running the following commands respectively.
To update Node, the easiest way is to download and reinstall the latest version from the official Node.js website.
Installing the latest version of Node will also update NPM. However, it's possible to update NPM independently by calling the following command.
Once you do this, the errors should no longer occur and you should be able to continue developing the components as normal.