本文介紹了events.js:160 拋出 er;//未處理的“錯誤"事件的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
限時送ChatGPT賬號..
我從事的項目是用 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;//未處理的“錯誤"事件的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!