我有两个ENOENT错误。我知道“ENOENT”的意思是“Error NO ENTrance”,但这两个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上有一个“lstat”问题,另一个在util.js上有一个“chmod”问题,但命令“node”,“npm”和“install”,“cwd”如何, “fstream”和Object.oncomplete?
这是writer.js:284。 这是writer.js:305。
答案 0 :(得分:7)
阅读错误行: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 :(得分:2)
阅读NPM日志的一个怪癖:要查看流中的第一个错误。上游错误可能导致文件丢失,从而导致许多错误,例如您上面报告的错误。
尝试转到日志的顶部,然后向下滚动,直到找到初始的第一个错误。