
Hi @Utkarsh Dubey,
Per my research, you should take following steps to fix the issue
- remove node js (using control panel)
- reinstall node js, you will need to install the correct version by refering following list
https://learn.microsoft.com/en-us/sharepoint/dev/spfx/compatibility
- Then try to run following script:
npm i -g gulp-cli yo
npm i -g @microsoft/generator-sharepoint
Here is a similar issue with yours
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.