簡體   English   中英

Next JS:錯誤:EPERM:不允許操作,rmdir

[英]Next JS : Error: EPERM: operation not permitted, rmdir

我有一個 Next.js 應用程序可以工作,然后當我離開它並回到它時我得到

  errno: -4048,
  code: 'EPERM',
  syscall: 'rmdir',
  path: 'C:\\Users\\gmacr\\Google Drive\\Optical-Font-Website\\O\\.next\\server\\pages'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! opt@0.1.0 dev: `next dev`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the opt@0.1.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\gmacr\AppData\Roaming\npm-cache\_logs\2021-10-16T21_14_26_886Z-debug.log 

我嘗試使用 npm clean cache。 使用 Windows 10。當我創建一個新的 Next 應用程序並復制我的工作文件時,程序運行沒有錯誤,直到我離開它一段時間然后再回來......

當項目目錄在“Google Drive”中時,它發生在我身上!!

您所要做的就是刪除“ .next"目錄。

或者在 package.json 中添加一個腳本來刪除它(windows 10 測試過):

 "scripts": {
    "dev": "(if exist .next rd /s /q .next 2>nul) && next dev",
},

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM