2016-08-09 8 views
16

私が取り組んだプロジェクトは、ガルプで構築されました。events.js:160 throw er; //処理されていない「エラー」イベント

最近ノードのバージョンをv6.3.1に更新しました。それから何かが間違っていた。

「html」という名前のタスクがエラーをスローします。ここにそのエラーコードの一部があります。

bogon:toClient work$ gulp html 
(node:2519) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version. 

[10:26:10] Using gulpfile ~/Project/TIME_Cancer_Treatment_Centers_of_America(CTCA)/toClient/gulpfile.js 
[10:26:10] Starting 'html'... 
(node:2519) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version. 

events.js:160 
     throw er; // Unhandled 'error' event 
    ^
Error: CSS parse error scripts/vendor.js: Unexpected input 
    1 |!function(t,e){"object"==typeof module&&"object"==typeof module.exports?module.exports=t.document?e(t,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return e(t)}:e(t)}("undefined"!=typeof window?window:this,function(t,e){function i(t){var e="length"in t&&t.length,i=J.type(t);return"function"!==i&&!J.isWindow(t)&&(!(1!==t.nodeType||!e)||("array"===i||0===e|| 

とタスクのコード「HTML」:

var $ = require('gulp-load-plugins')(); 

gulp.task('html', function() { 
    var assets = $.useref.assets({searchPath: ['.tmp']}); 

    return gulp.src('app/*.html') 
    .pipe(assets) 
    .pipe($.if('*.js', $.uglify())) 
    .pipe($.if('*.css', $.csso())) 
    .pipe(assets.restore()) 
    .pipe($.useref()) 
    .pipe($.if('*.html', $.minifyHtml({conditionals: true, loose: true}))) 
    .pipe(gulp.dest('dist')); 
}); 

私は多くのことをグーグルが、私は私のために適した適切な答えを見つけることができます。

+2

[Node.jsの - イベントJS 72スローER未処理の 'エラー' イベント]の可能性のある重複(http://stackoverflow.com/questions/22960703/node-js-events-js-72-throw- er-unhandled-error-event) –

答えて

25

node_modulesフォルダを削除して新規インストールを行うと、この問題が解決されました。

rm -rf node_modules && npm cache clean --force && npm install 

私は、ノードv6.7.0に

ソース実行しています:私はevents.jsと同様の問題があったhttps://github.com/ember-cli/ember-cli/issues/3087#issuecomment-71327402

+0

ありがとう!私はこれを試して、これも私のために働いた。 –

2

最近、ノードのバージョンをv5.10.0に変更し、すべてがうまく機能しました。

+3

これを試してみてください。動作しません。 –

1

を。私は(完全なシステムの再インストール後に)私のGemfileから宝石をインストールするのを忘れたので、私の場合問題に

[19:59:06] Starting 'jekyll-async'... 

events.js:72 
    throw er; // Unhandled 'error' event 
     ^
Error: spawn ENOENT 
    at errnoException (child_process.js:1011:11) 
    at Process.ChildProcess._handle.onexit (child_process.js:802:34) 

が発生しました。

だから、私の治療法は:

gem install jekyll 
-1

あなたのノードをアンインストールし、最新のバージョンをインストールすることができます。私の場合は

+0

これは必要ありません。 – lasec0203

1

すでに使用中のポート..

# netstat -nltp 

チェックwith..ifはい変更ポートを起動してみてくださいしようとしているポートで実行されている任意のものがあります。

いくつかの例のIPアドレスもよい間違って次の行でエラーについて静的IP

6

を使用している場合:

events.js:160 
     throw er; // Unhandled 'error' event 
私にとっての問題は、私はすでに別のローカル・ノード上で開いているポートを持っていたということでした

アプリ。

他のアプリを停止すると問題が解決しました。

1

他のgulpプロセスを強制終了させて​​ください。

ps -ax | grep gulp 
kill -9 <number> 
0

events.js:160

サーバーからのノードのポートを変更するよう

  1. ポートが別のノードを使用しているためです。js

    2.orまたは他のアプリを停止して同じポートを使用します。

関連する問題