Skip to content

Error while running npm install after creating a Vite project #8260

@Shubhrasankharoy

Description

@Shubhrasankharoy

Issue: Error while running npm install after creating a Vite project

Steps to reproduce:

  1. Run the following command to create a Vite project:
npm create vite@latest
  • Choose "React" as the framework.

  • Choose "JavaScript" as the variant.

  1. Navigate to the project folder and run:
npm install

Expected outcome:

  • Successful installation of the dependencies.

Actual outcome:

  • The following warning and error messages appear:
npm warn cleanup Failed to remove some directories [
npm warn cleanup   [
npm warn cleanup     '\\\\?\\C:\\Nature\\CODE\\All-in-one\\test\\node_modules',
npm warn cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\Nature\CODE\All-in-one\test\node_modules\@babel\core\lib\config'] {
npm warn cleanup       errno: -4048,
npm warn cleanup       code: 'EPERM',
npm warn cleanup       syscall: 'rmdir',
npm warn cleanup       path: 'C:\\Nature\\CODE\\All-in-one\\test\\node_modules\\@babel\\core\\lib\\config'
npm warn cleanup     }
npm warn cleanup   ],
npm warn cleanup   [
npm warn cleanup     '\\\\?\\C:\\Nature\\CODE\\All-in-one\\test\\node_modules\\@eslint-community',
npm warn cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\Nature\CODE\All-in-one\test\node_modules\@eslint-community'] {
npm warn cleanup       errno: -4048,
npm warn cleanup       code: 'EPERM',
npm warn cleanup       syscall: 'rmdir',
npm warn cleanup       path: 'C:\\Nature\\CODE\\All-in-one\\test\\node_modules\\@eslint-community'
npm warn cleanup     }
npm warn cleanup   ]
npm warn cleanup ]

npm error code ERR_INVALID_ARG_TYPE
npm error The "file" argument must be of type string. Received undefined
npm error A complete log of this run can be found in: C:\Users\akash roy\AppData\Local\npm-cache\_logs\2025-04-26T15_09_29_738Z-debug-0.log

Additional Information:

  • I have uninstalled Node.js, deleted all npm and node_modules folders manually, and reinstalled Node.js.

  • Still, the same problem persists.

  • The error seems related to permission issues when trying to remove certain directories.

  • It indicates rmdir operations failing due to EPERM errors.

Has anyone encountered this issue before? Any suggestions for fixing it?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions