skip to Main Content

After I create a project with npm create vite@latest then I installed npm and then I want to start project with npm un dev.but I have some error.Fore example this error:
Error: Cannot find module @rollup/rollup-win32-x64-msvc. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try npm i again after removing both package-lock.json and node_modules directory.
at requireWithFriendlyError (C:vite-react-appmy-vitenode_modulesrollupdistnative.js:64:9)
at Object. (C:vite-react-appmy-vitenode_modulesrollupdistnative.js:73:48)
I do not know module @rollup-win32-x4-msvc.Should this module exist in proect?I put a photo from errors in building my project below.
error

2

Answers


  1. In error mentioned doing this.

    Please try npm i again after removing both the package-lock.json and node_modules directory.
    
    

    I think you should try that, May it resolve the issue

    Steps

    1. Remove lock file and node_modules
    2. Run command npm i
    Login or Signup to reply.

  2. It seems like you’re encountering an issue related to the @rollup/rollup-win32-x64-msvc module while trying to build your Vite project. The error message suggests that there’s an issue with resolving this module. This might be due to a problem with the dependencies or the build environment.

    — Here are some steps you can take to address this issue:

    rm -rf node_modules
    rm package-lock.json
    

    — After that, run npm install again:

    npm install
    

    — Check Node.js and npm versions:
    Ensure that you are using a compatible version of Node.js and npm. Some packages might have specific requirements. You can check the recommended versions in the Vite documentation or in the package.json file of your project.

    Verify Dependencies:
    Check your package.json file for any dependencies that might be causing conflicts. Ensure that all dependencies are compatible with each other. You can also try updating the dependencies to the latest versions:

    npm update
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search