Scenario:

One of our developer was getting this error, after she took the latest code of DevOps. This application was angular 11 with ASP.net core 3.1.

Exact Error:

AggregateException: One or more errors occurred. (One or more errors occurred. (The NPM script ‘start’ exited without indicating that the Angular CLI was listening for requests. The error output was: An unhandled exception occurred: Cannot find module ‘posix-character-classes’

After a bit of research, we found that we found that we need to update angular and npm version.

Command:

npm update 
ng update
// alternatively
npm update -g
np update -g

However, this solution did not work in our case. Furthermore research, I observed that clientApp’s (angular application) folder was having node_modules folder from Azure DevOps as shown.

This was supposed to create based on user build and not from source control. Therefore, I deleted the folder from the angular application and rebuild the solution. And this time it works and resolved the issue.

Solution:

Remove the node_modules folder from angular application.

ng serve –open

Regards

Rijwan

By Rijwan Ansari

Research and Technology Lead | Software Architect | Full Stack .NET Expert | Tech Blogger | Community Speaker | Trainer | YouTuber. Follow me @ https://rijsat.com Md Rijwan Ansari is a high performing and technology consultant with 10 plus years of Software Development and Business Applications implementation using .NET Technologies, SharePoint, Power Platform, Data, AI, Azure and cognitive services. He is also a Microsoft Certified Trainer, C# Corner MVP, Microsoft Certified Data Analyst Associate, Microsoft Certified Azure Data Scientist Associate, CSM, CSPO, MCTS, MCP, with 15+ Microsoft Certifications. He is a research and technology lead in Tech One Global as well as leading Facebook community Cloud Experts Group and SharePoint User Group Nepal. He is a active contributor and speaker in c-sharpcorner.com community, C# Corner MVP and his rank at 20 among 3+ millions members. Additionally, he is knee to learn new technologies, write articles, love to contribute to the open-source community. Visit his blog RIJSAT.COM for extensive articles, courses, news, videos and issues resolution specially for developer and data engineer.

One thought on “The error output was: An unhandled exception occurred: Cannot find module ‘posix-character-classes’”

Leave a Reply

Your email address will not be published.