events.js:160 抛出 er;//未处理的“错误"事件

events.js:160 throw er; // Unhandled #39;error#39; event(events.js:160 抛出 er;//未处理的“错误事件)
本文介绍了events.js:160 抛出 er;//未处理的“错误"事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从事的项目是用 gulp 构建的.

The project I worked on was built with gulp.

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

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

名为html"的任务引发错误.这是它的错误代码部分.

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

以及任务'html'的代码:

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.

推荐答案

删除 node_modules 文件夹,清除 npm 缓存文件并进行全新安装,即可解决此问题.

removing the node_modules folder, clearing npm cached files, and doing a fresh install, resolves this issue.

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

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

这篇关于events.js:160 抛出 er;//未处理的“错误"事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Update another component when Formik form changes(当Formik表单更改时更新另一个组件)
Formik validation isSubmitting / isValidating not getting set to true(Formik验证正在提交/isValiating未设置为True)
React Validation Max Range Using Formik(使用Formik的Reaction验证最大范围)
Validation using Yup to check string or number length(使用YUP检查字符串或数字长度的验证)
Updating initialValues prop on Formik Form does not update input value(更新Formik表单上的初始值属性不会更新输入值)
password validation with yup and formik(使用YUP和Formick进行密码验证)