2014-02-25 316 views
9

我有2個ENOENT錯誤。我知道「ENOENT」的意思是「Error NO ENTrance」,但是這兩個ENOENT中缺少的是什麼?這些錯誤信息是什麼意思?我想破譯它們來調試問題。如何閱讀npm ENOENT錯誤

npm ERR! Error: ENOENT, lstat '/home/ubuntu/.npm/iconv-lite/0.2.11/package/encodings/table/gbk.js' 
npm ERR! If you need help, you may report this *entire* log, 
npm ERR! including the npm and node versions, at: 
npm ERR!  <http://github.com/npm/npm/issues> 

npm ERR! System Linux 3.2.0-54-virtual 
npm ERR! command "/home/ubuntu/local/bin/node" "/home/ubuntu/local/bin/npm" "install" 
npm ERR! cwd /home/ubuntu/app_e 
npm ERR! node -v v0.10.26 
npm ERR! npm -v 1.4.3 
npm ERR! path /home/ubuntu/.npm/iconv-lite/0.2.11/package/encodings/table/gbk.js 
npm ERR! fstream_path /home/ubuntu/.npm/iconv-lite/0.2.11/package/encodings/table/gbk.js 
npm ERR! fstream_type File 
npm ERR! fstream_class FileWriter 
npm ERR! code ENOENT 
npm ERR! errno 34 
npm ERR! fstream_stack /home/ubuntu/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:284:26 
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15) 

npm ERR! Error: ENOENT, chmod '/home/ubuntu/app_f/node_modules/grunt/lib/grunt/util.js' 
npm ERR! If you need help, you may report this *entire* log, 
npm ERR! including the npm and node versions, at: 
npm ERR!  <http://github.com/npm/npm/issues> 

npm ERR! System Linux 3.2.0-54-virtual 
npm ERR! command "/home/ubuntu/local/bin/node" "/home/ubuntu/local/bin/npm" "install" 
npm ERR! cwd /home/ubuntu/app_f 
npm ERR! node -v v0.10.26 
npm ERR! npm -v 1.4.3 
npm ERR! path /home/ubuntu/app_f/node_modules/grunt/lib/grunt/util.js 
npm ERR! fstream_path /home/ubuntu/app_f/node_modules/grunt/lib/grunt/util.js 
npm ERR! fstream_type File 
npm ERR! fstream_class FileWriter 
npm ERR! fstream_finish_call chmod 
npm ERR! code ENOENT 
npm ERR! errno 34 
npm ERR! fstream_stack /home/ubuntu/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:305:19 
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15) 
npm http GET https://registry.npmjs.org/graceful-fs 

人似乎對gbk.js,另一個是「文件模式」的問題上util.js中,但什麼命令「節點」的「LSTAT」的問題, 「npm」和「install」,「cwd」,「fstream」和Object.oncomplete?

這是writer.js:284。 這是writer.js:305

回答

6

讀取錯誤行:Error: ENOENT, lstat '/home/ubuntu/.npm/iconv-lite/0.2.11/package/encodings/table/gbk.js'

這意味着,做這樣的事情fs.lstat('/home/ubuntu/.npm/iconv-lite/0.2.11/package/encodings/table/gbk.js', ...)時,NPM收到ENOENT錯誤。這意味着文件丟失,但npm預計它在那裏。

而對於第二個,npm正在做類似fs.chmod('/home/ubuntu/app_f/node_modules/grunt/lib/grunt/util.js', ...)和npm收到ENOENT錯誤。

其餘的是調試信息。這些都是發生錯誤時的一些變量/屬性:

npm ERR! System Linux 3.2.0-54-virtual --> THis is the system type 
npm ERR! command "/home/ubuntu/local/bin/node" "/home/ubuntu/local/bin/npm" "install" --> the command that was issued 
npm ERR! cwd /home/ubuntu/app_f --> The current working directory 
npm ERR! node -v v0.10.26 --> You should know this one! 
npm ERR! npm -v 1.4.3 --> You should know this one! 
npm ERR! path /home/ubuntu/app_f/node_modules/grunt/lib/grunt/util.js 

這些是關於fstream module。它表明它究竟做了什麼。

npm ERR! fstream_path /home/ubuntu/app_f/node_modules/grunt/lib/grunt/util.js 
npm ERR! fstream_type File 
npm ERR! fstream_class FileWriter 
npm ERR! fstream_finish_call chmod 

這是堆棧跟蹤(類似的conosle.log(new Error().stack)輸出)當發生錯誤:

npm ERR! fstream_stack /home/ubuntu/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:305:19 
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15) 
1

一個與閱讀NPM日誌怪癖:得看流中的第一個錯誤。上游的錯誤可能導致文件丟失,導致許多錯誤,如上面報告的錯誤。

嘗試進入日誌頂部,然後向下滾動,直到找到初始的第一個錯誤。