Npm Install is failing for SPFx webpart

sns 9,226 Reputation points
2022-05-05T09:33:51.987+00:00

Even I ran npm install it is failing and please find the attached screenshot and logs.
199212-nonodemodules.png199213-logs.txt199214-npmissue.png

SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
2,236 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,745 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,686 questions
{count} votes

Accepted answer
  1. RaytheonXie_MSFT 31,681 Reputation points Microsoft Vendor
    2022-05-06T06:12:51.687+00:00

    Hi @sns , To fix this error, you can follow the steps.

    1. Delete node modules npm install rimraf -g
      rimraf node_modules
    2. Delete package-lock.json file
    3. clean npm as administrator. npm cache clean --force
    4. run npm install

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



1 additional answer

Sort by: Most helpful
  1. sns 9,226 Reputation points
    2022-05-06T08:37:32.477+00:00

    Please share me the exact command to roll back to 12, I was doing google but it is giving errors for me.