events.js:160扔呃; //未处理“错误”事件 [英] events.js:160 throw er; // Unhandled 'error' event

查看:137
本文介绍了events.js:160扔呃; //未处理“错误”事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的这个项目是用吞噬建造的。

最近我将节点版本更新为v6.3.1。然后出现了一些问题。

名为'html'的任务会引发错误。

  bogon:toClient工作$ gulp html 
(节点:2519)这是错误代码的一部分。 fs:不支持重新评估本地模块源代码。如果您使用的是graceful-fs模块,请将其更新为更新的版本。

[10:26:10]使用gulpfile〜/ Project / TIME_Cancer_Treatment_Centers_of_America(CTCA)/toClient/gulpfile.js
[10:26:10]开始'html'...
(节点:2519)fs:不支持重新评估本地模块源。如果您使用的是graceful-fs模块,请将其更新为更新的版本。

events.js:160
throw er; //未处理'错误'事件
^
错误:CSS解析错误脚本/ vendor.js:意外输入
1 |!function(t,e){object== typeof module& amp; ;&object== typeof module.exports?module.exports = t.document?e(t,!0):function(t){if(!t.document)throw new Error(jQuery需要一个窗口(t)e(t)}(undefined!= typeof window?window:this,function(t,e){function i(t){var e =length在t&< t.length,i = J.type(t); returnfunction!== 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']});

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

我搜索了很多,但没有找到适合我的正确答案。

解决方案

删除node_modules文件夹并进行全新安装,为我解决了这个问题。

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

我正在运行node v6.7.0



来源: https://github.com/ember -cli / ember-cli / issues / 3087#issuecomment-71327402


The project I worked on was built with gulp.

Recently I updated the node version to v6.3.1. Then something came wrong.

A task named 'html' throws an error. Here is the part of error code of it.

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||

And the code of task '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'));
});

I googled a lot but I haven't found a proper answer suitable for me.

解决方案

removing the node_modules folder and doing a fresh install, resolved this issue for me.

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

I'm running node v6.7.0

source: https://github.com/ember-cli/ember-cli/issues/3087#issuecomment-71327402

这篇关于events.js:160扔呃; //未处理“错误”事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆