Tag: gulp

gulp-clean:不能删除当前工作目录之外的文件

当我在我的angular2项目中运行命令 咕噜咕噜咕噜咕噜咕噜。 请任何人解释这个问题的根源是什么,或者这个有什么问题。我会高度赞赏吗?

无法在Gulp下运行项目

我是前端开发新手,我有一些现有的项目,我无法运行。 文档说,要运行我应该执行的项目: $ gulp && gulp serve 但是,我收到以下错误: /home/alex/some/project/node_modules/@types/gulp/index.d.ts(15,15): error TS2430: Interface 'Gulp' incorrectly extends interface 'Orchestrator'. Types of property 'task' are incompatible. Type 'AddMethod' is not assignable to type '{ (name: string): Task; (name: string, fn: TaskFunc): void; (name: string, dep: string[], fn: Tas…'. Type 'Orchestrator' is not assignable to type 'Task'. Property 'fn' […]

我真的搞砸了NPM

我想我真的搞砸了NPM。 所以我试图让一口气工作,这是不是所以我试图改变路线,但错误,我猜我正在看的文章是为Mac,我有窗户。 无论如何,我试图做一个解决scheme,并在当时仍然工作,所以我打开了NPMconfiguration编辑和一个文件来改变前缀,但当我这样做,我不小心只是复制和粘贴,而不是把我的实际计算机的用户名,现在npm不会工作,甚至加载任何东西,我想重新安置文件,但我不能使用npm现在,我找不到文件。 我正在使用这个帮助我npm – EPERM:操作不允许在Windows上

在Node.js中构造两个Transformstream

我有一个无操作转换streamtesting,输出通过它传递的所有文件的列表。 为什么下面的代码只输出一次文件列表? 我如何正确组合两个stream? var composed = test().pipe(test()); gulp.src('source/*').pipe(composed);

运行gulp服务时出错

所以我试图build立一个开发环境,我使用吞咽。 但是,安装完所有依赖后,我得到这个错误: Hariss-MacBook-Pro:teacher haris$ gulp serve [19:00:28] Using gulpfile ~/teacher/gulpfile.js [19:00:28] Starting 'statics'… [19:00:28] Finished 'statics' after 1.92 ms [19:00:28] Starting 'jshint'… [19:00:28] Starting 'clean-css'… [19:00:28] Starting 'templates'… [19:00:28] Server started on 3000 port [19:00:28] Finished 'clean-css' after 12 ms [19:00:28] Starting 'styles'… [19:00:28] Finished 'templates' after 35 ms [19:00:28] Finished 'jshint' after 336 ms […]

当API返回204没有内容时使用“gulp服务”获取代理错误

我正在使用Gulp来开发由Yeoman的吞咽angular生成器生成的Angular应用程序。 我已经configuration它代理请求到/api到另一个端口,我的API正在监听的端口。 该端口实际上是通过SSH隧道转发到外部服务器。 这里是我为自己的API编辑的Yeoman生成的configuration: 一饮而尽/ server.js 'use strict'; var gulp = require('gulp'); var browserSync = require('browser-sync'); var httpProxy = require('http-proxy'); /* This configuration allow you to configure browser sync to proxy your backend */ var proxyTarget = 'http://localhost:3434/api'; // The location of your backend var proxyApiPrefix = 'api'; // The element in the URL which […]

吞噬 – 导致任务停止的错误

我正在使用Gulp和Browserify一起设置一个项目,但是我在获取监视命令时会遇到一些小问题,以便发现错误并继续观察。 我使用默认任务(下面的代码)运行“gulp”命令。 这个任务使用watch设置来捕获我的文件中的任何更改,然后使用Browserify编译我的js,并编译我的scss文件。 一切顺利,除非我在我的js语法错误。 基本上,如果发生这种情况控制台显示错误,但不再捕捉到我的js文件的更改。 我最初省略了导致整个监视任务失败的error handling,但是现在我已经在那里了 – 监视任务仍在继续,对于我的scss(即使我犯了一个语法错误)它工作得很好,但它赢了对我的js没有任何改变。 var gulp = require('gulp'), gutil = require('gulp-util'), browserify = require('browserify'), changed = require('gulp-changed'), compass = require('gulp-compass'), uglify = require('gulp-uglify'), livereload = require('gulp-livereload'), transform = require('vinyl-transform'), sassSources = ['_src/sass/**/*.scss'], jsSources = ['_src/js/admin.js', '_src/js/main.js']; var onError = function (err) { gutil.log(gutil.colors.green(err)); }; gulp.task('js', function() { var browserified = […]

尽pipe它存在,但是Gulp要求“找不到模块”

我遇到了一个奇怪的问题,我现在想尽办法。 我试图学习JSunit testing,所以我正在与Jasmine一起build立一个gulp。 问题是,当我的gulp版本运行时,我得到: Error: Cannot find module 'gulp-jasmin' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require (module.js:364:17) at require (module.js:380:17) at Object.<anonymous> (/Users/path/to/project/gulpfile.js:5:19) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17) 现在,我知道这是一个普遍的问题,但我已经尝试了所有解决这些问题的方法。 我的package.json : { "name": "boxfish", "version": "0.3.0", "devDependencies": { "gulp": "^3.9.0", "gulp-jasmine": "^2.0.1", "gulp-livereload": "^3.8.0", […]

在gulp中执行任意节点脚本

我想运行一个index.js文件作为我的吞咽过程的一部分。 我可以像这个线程( 如何在gulp中运行bash命令? )中描述的那样通过像gulp-shell这样的东西添加node index.js ,但似乎应该有一个更简单的方法。 我觉得会有一个名为gulp-node的插件或者其他的东西来做,但是它不存在。 别人怎么做,而不把你的初始脚本变成一个吞咽插件,这似乎侵入?

export NODE_ENV =生产不会改变gulpfile.js中的process.env.NODE_ENV

我试图设置环境variables$ NODE_ENV为“生产” export NODE_ENV=production 但是当我尝试运行我的吞噬任务时,它说variables是未定义的: if((process.env.NODE_ENV).trim().toLowerCase() !== 'production') { ^ TypeError: Cannot read property 'trim' of undefined at Object.<anonymous> (/Users/mmarinescu/Projects/gulpTutorial/gulpfile.js:15:26) at Module._compile (module.js:435:26) at Object.Module._extensions..js (module.js:442:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:311:12) at Module.require (module.js:366:17) at require (module.js:385:17) at Liftoff.handleArguments (/usr/local/lib/node_modules/gulp/bin/gulp.js:116:3) at Liftoff.<anonymous> (/usr/local/lib/node_modules/gulp/node_modules/liftoff/index.js:192:16) at module.exports (/usr/local/lib/node_modules/gulp/node_modules/liftoff/node_modules/flagged-respawn/index.js:17:3) 如果我echo $NODE_ENV ,则显示生产关键字。 在这个例子中,我的gulp设置如下: var devBuild = ((process.env.NODE_ENV).trim().toLowerCase() […]