NPM: ENOENT: no such file or directory, rename

后端 未结 13 2181
耶瑟儿~
耶瑟儿~ 2021-02-05 08:38

I was using gulp on the project, then i decide to deleted all the dev dependencies to switch to webpack, but every time i try to install using npm is get this error:

<         


        
相关标签:
13条回答
  • 2021-02-05 08:50

    Iam using
    -node v15.5.0

    -npm v6.14.10

    Try this:

    1. close "expo start"
    2. remove "package-lock.json"
    3. Try to install packages now

    example: npm i @react-navigation/native

    This will fix the issue.

    0 讨论(0)
  • 2021-02-05 08:51

    cache verify command resolved the issue for me

    npm cache verify
    
    0 讨论(0)
  • 2021-02-05 08:52

    I just retried to run

    npm install 
    

    and it succeeded

    0 讨论(0)
  • 2021-02-05 08:53

    The second line may give a hint on what's happening:

    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Error: EPERM: operation not permitted, rename 'C:\Users\MiguelFrias\Desktop\Therabytes\node_modules\.staging\fsevents-e80c4ef4\node_modules\are-we-there-yet' -> 'C:\Users\MiguelFrias\Desktop\Therabytes\node_modules\.staging\are-we-there-yet-5db4c798'
    

    It looks like npm doesn't have enough permission on the folder you're trying to use.

    You can try:

    • Delete the npm_modules again.
    • Open whatever editor/terminal you're using to npm install with admin permission.
    0 讨论(0)
  • 2021-02-05 09:00

    If your app is running on npm you may need to stop it before you add or install anything. I had this problem several times. I was running my react native app with expo cli. After closing the expo cli and closing chrome , my problem was fixed.

    0 讨论(0)
  • 2021-02-05 09:01

    When I got this error I looked for all running instances of node in my task manager (i use process explorer on windows) and close/kill all running instances of node. For me its often webstorm or vs code. After closing these programs and ensuring there is no running node process npm install works again.

    0 讨论(0)
提交回复
热议问题