2017-06-05 253 views
1

當我試圖在流星https://github.com/vsivsi/meteor-job-collection流星錯誤:ENOTEMPTY:目錄不是空

它會下載100%,提取加載以下包,但在裝貨時,它拋出以下錯誤:

{ [ 
Error: ENOTEMPTY: directory not empty, rmdir 'C:\Users\LALITS~1\AppData\Local\Temp\mt-16riklk\npm\job\node_modules'] 
    errno: -4051, 
    code: 'ENOTEMPTY', 
    syscall: 'rmdir', 
    path: 'C:\\Users\\LALITS~1\\AppData\\Local\\Temp\\mt-16riklk\\npm\\job\\node_modules' } 

我使用的是Windows 8.1 64位。 我試圖手動刪除該文件夾,但它又創建了一個新的並引發相同的錯誤。誰能告訴我有什麼問題?我錯過了什麼嗎?

在此先感謝。

+0

你有什麼舊版本仍在運行?您是否嘗試過重新啓動機器? –

+0

是的,我重新啓動了機器並進行了檢查。 –

+0

我正在使用流星1.4.4.3 –

回答

0

你的問題看起來像這個已知的流星bug: https://github.com/meteor/meteor/issues/8663。當更新到下一個Meteor版本時,此錯誤在Windows下發生。

也許你可以嘗試提出解決方案,這是編輯以下文件:

C:\Users\[yourName]\AppData\Local\.meteor\packages\meteor-tool\[yourMeteorVersion]\mt-os.windows.x86_32\tools\fs\files.js 

...並使用此代碼替換功能files.rm_recursive_asyncfiles.rm_recursive

files.rm_recursive_async = function (path) { 
    return new Promise(function (resolve, reject) { 
    rimraf(files.convertToOSPath(path), function (err) { 
     err && console.log(err); 
     resolve(); 
     //return err ? reject(err) : resolve(); 
    }); 
    }); 
}; // Like rm -r. 

files.rm_recursive = Profile("files.rm_recursive", function (path) { 
    try { 
    rimraf.sync(files.convertToOSPath(path)); 
    } catch (e) { 
    if (e.code === "ENOTEMPTY" && canYield()) { 
     files.rm_recursive_async(path).await(); 
     return; 
    } 

    console.log(e); 
    //throw e; 
    } 
}); // Makes all files in a tree read-only.