Recently, while I was trying to create a new SPFx (SharePoint Framework) solution using the yo @microsoft/sharepoint command, the process failed and displayed more than 100 npm warnings. Then, at last, it displays some errors like:
EPERM: operation not permitted, rmdir '…\node_modules\@rushstack…'
EBADF: bad file descriptor, write
“failed to remove directories”
Recent .bin files or .ps1 scripts are missing.

I couldn’t find any clear solution because these errors do not directly say what the actual root cause was, until I figured it out after researching.
Problem: npm ERR! enoent ENOENT: no such file or directory, open ‘node_modules.bin\parser.ps1’
When running the npm install as a part of the yo @microsoft/sharepoint [SPFx solution scaffolding], you may see thousands of warnings followed by errors like below:
- EPERM – permission denied
- ENOENT – No such file or directory
- EBADF – bad file descriptor
We might think these errors are related to Node.js or npm permission issues, but they can also occur due to our C: or D: drives running out of space. In the image below, you can see that my D drive is out of space.

Solution
Free up the space on the drive where you’re trying to create a solution. Then try to create a new SPFx solution; this time, you won’t get these types of issues. As shown in the image below, I have freed up my space, and the solution was created successfully.

In this tutorial, I explained how to fix the error “npm install Failed: ENOENT, EPERM rmdir, EBADF Errors” while creating SPFx solutions. The issue is caused by a lack of space in our local system while creating the SPFx solution. Do let me know in the comment below if this helps.
You may also like the following tutorials:
- SPFx Error: Couldn’t add this app.
- Delete node_modules from SPFx solution (rimraf)
- can’t load the application on this page. use the browser back button to retry. if the problem persists, contact the administrator of the site and give them the information in technical details.
- property ‘marquee’ does not exist on type ‘jsx.intrinsicelements’
- Cannot find module ‘@microsoft/sp-build-web’

Hey! I’m Bijay Kumar, founder of SPGuides.com and a Microsoft Business Applications MVP (Power Automate, Power Apps). I launched this site in 2020 because I truly enjoy working with SharePoint, Power Platform, and SharePoint Framework (SPFx), and wanted to share that passion through step-by-step tutorials, guides, and training videos. My mission is to help you learn these technologies so you can utilize SharePoint, enhance productivity, and potentially build business solutions along the way.