Tag: 吞噬

在npm中使用postinstall脚本

我正在使用packages.json中的以下postinstall。 "scripts": { "start": "node server.js", "postinstall": "bower install –config.interactive=false && gulp build" }, 但是, &&在某些环境中不受支持。 如何将等效命令放在postinstall.js脚本中,以便我可以同时执行这两个命令?

咕噜玉报告错误,如'不能读取属性'xxx'未定义'

当我使用gulp-jade@1.1.0来编译“index.jade” <!DOCTYPE html> html(lang="en") head meta(charset="UTF-8") title Document body – var json = {'foo': 'bar'} include template 包括“template.jade” h1= json.foo g蛤蟆总是报错 [15:11:34] Starting 'jade'… [15:11:34] Starting 'sass'… [15:11:34] Finished 'sass' after 2.68 ms [15:11:34] Plumber found unhandled error: TypeError in plugin 'gulp-jade' Message: C:\Users\Administrator\Desktop\workspace\node\src\jade\template.jade:1 > 1| h1= json.foo Cannot read property 'foo' of undefined Details: […]

使用gulp-data和gulp-jade与目录一起使用

我有一个工作stream程,一切正常,但它似乎只能在最上面的文件,例如: public/index.html ,但如果我想要使用public/products/item.html , public/products/item.html 数据会抛出一个错误,并寻找src/json/item.json而不是src/json/products/item.json 。 我觉得有一些错误,因为我用path.basename(file.path, '.jade') + '.json') ,它只会返回文件名,当然,如果是的话,如何使它也提供目录如果它抛出像products/item.jade东西? var basePath = { src: 'src/', dest: 'public/' } var src = { pages: basePath.src + 'jade/', json : basePath.src + 'json' } gulp.task('make:pages', function() { return gulp.src(src.pages + '**/!(_)*.jade') .pipe(plumber({ errorHandler: onError })) .pipe(data(function(file) { return JSON.parse(fs.readFileSync('src/json/' + path.basename(file.path, '.jade') + '.json')); […]

在php中执行gulp返回错误,但在shell中工作

从php脚本执行gulp有一个奇怪的问题。 testing: browser: http://server.com/pull.php <- does not work shell: php pull.php <- works shell: gulp <- works 这是我的设置: Ubuntu 12.04.5 LTS Node v5.6.0 PHP 5.5.30-1+deb.sury.org~precise+1 (cli) (built: Oct 4 2015 16:14:34) Copyright (c) 1997-2015 The PHP Group Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies […]

在运行.js文件中进行更改时运行gulp服务时发生错误

我正在改变几个UI文件,但大部分时间我的吞噬服务崩溃与低于错误。 撤消这些变化之后,但仍然失败。 作为一个解决scheme我需要删除凉亭componets并重新安装UI组件(npm安装,bower安装,gulp服务)错误: events.js:141 throw er; // Unhandled 'error' event ^ TypeError: must start with number, buffer, array or string at fromObject (buffer.js:167:9) at new Buffer (buffer.js:58:10) at DestroyableTransform._transform (D:\Hygieia\UI\node _modules\wiredep\wiredep.js:135:23) at DestroyableTransform.Transform._read (D:\Hygieia\UI \node_modules\wiredep\node_modules\through2\node_modules\readable-stream\lib_st ream_transform.js:184:10) at DestroyableTransform.Transform._write (D:\Hygieia\U I\node_modules\wiredep\node_modules\through2\node_modules\readable-stream\lib_s tream_transform.js:172:12) at doWrite (D:\Hygieia\UI\node_modules\wiredep\node_mo dules\through2\node_modules\readable-stream\lib_stream_writable.js:237:10) at writeOrBuffer (D:\Hygieia\UI\node_modules\wiredep\n ode_modules\through2\node_modules\readable-stream\lib_stream_writable.js:227:5) at DestroyableTransform.Writable.write (D:\Hygieia\UI\ node_modules\wiredep\node_modules\through2\node_modules\readable-stream\lib_str eam_writable.js:194:11) at […]

Gulp Watching创build无限循环而不更改文件

类似于其他问题,在这个非常淡化的代码片断中,运行默认的 gulp任务(通过npm start运行gulp ); 这段代码创build了一个循环运行脚本任务的无限循环。 这里是gulpfile.js (字面上目前是整个事情): 'use strict'; const gulp = require('gulp'); // COPY SCRIPTS TO BUILD FOLDER gulp.task('scripts', function() { return gulp.src('./scripts/**/*.js') .pipe(gulp.dest('build/scripts')) }); // WATCH FILES gulp.task('watch', function() { gulp.watch('./scripts/**/*.js', ['scripts']); }); // DEFAULT gulp.task('default', ['watch']); 更奇怪的是,不pipebuild文件夹是否重build ,脚本任务将在调用npm start后立即执行! 循环开始。 如果你好奇,这里是我的package.json中粘贴的(也是唯一的)脚本对象: "scripts": { "test": "echo \"Error: no test specified\" && exit 1", […]

量angular器吞咽运行一个单一的spec文件

这是我的量angular器conf文件 exports.config = {framework:'jasmine', seleniumAddress: 'http://localhost:4444/wd/hub', specs: ['../../e2e/smoke-test/*.spec.js'], ignoreSynchronization: 'true', jasmineNodeOpts: { defaultTimeoutInterval: 2500000, allScriptsTimeout: 25000000 } }; 这是我的gulp conf文件 'use strict'; var path = require('path'); var gulp = require('gulp'); // Protractor configurations to open browser var protractor = require("gulp-protractor").protractor; var spawn = require('child_process').spawn; var browserSync = require('browser-sync'); var $ = require('gulp-load-plugins')(); // Downloads the […]

TypeError:from.pipe不是吞食泵的function

我正在使用下面的gulpfileconfiguration: gulp.task('watch', (cb) => { pump([ nodemon({ script: './server.js', ext: 'js', ignore: [ './dist', './public' ] }), gulp.watch('public/js/**/*.js', [ 'build-js' ]), gulp.watch('public/less/**/*.less', [ 'build-css' ]), gulp.watch([ 'public/views/**/*.html', 'public/index.html' ], [ 'build-html' ]) ], cb) }) 只要服务器文件发生更改,它就会重新启动服务器,或者在./public文件更改时运行相应的生成任务。 构build任务只是简单的缩小和concat任务,它们自己工作正常,所以这不是问题。 现在每当我运行它,我得到以下stacktrace: [15:52:51] 'watch' errored after 69 ms [15:52:51] TypeError: from.pipe is not a function at pipe (/home/linux/IdeaProjects/project/node_modules/pump/index.js:54:15) at […]

无法使用gulp编译代码

实际上我有一个基于angularjs的项目,我需要做的是编译代码并使用gulp创build文件夹。 / 错误 => [12:03:39]使用gulpfile E:\ projects \ public \ public \ gulpfile.js [12:03:39]开始'mkdir:tmp'… [12:03:39]configuration'… [12:03:39] 9.6 ms后完成'config'[12:03:39]'mkdir:tmp'23 ms后出错[12:03:39]错误:命令失败:rm -rf E:\ projects \ public \ public / tmp && mkdir -p E:\ projects \ public \ public / tmp'rm'不被识别为内部或外部命令,可操作程序或batch file。 在位于maybeClose(internal / child_process.js:877:16)的ChildProcess.emit(events.js:191:7)处的emitTwo(events.js:106:13)处的ChildProcess.exithandler(child_process.js:206:12)在sockets。 (内部/ child_process.js:334:11)在位于Pipe._handle.close的Socket.emit(events.js:188:7)的emitOne(events.js:96:13) 498:12)* / 当我使用del而不是rm命令时,进程没有完成 / * Gulpfile.js * / gulp.task('default', ['build']); […]

注入npm依赖的吞咽

我使用gulp compilatorangular度。 我使用了bower依赖,我把它们全部移到了npm。 我有注入依赖脚本的问题。 这是我目前的注入代码。 如何更改wiredep到另一个库来处理npm注入,因为我有Uncaught ReferenceError:angular没有定义,var angular = require(angular)不起作用。 是否有任何简单的解决scheme注入npm的依赖脚本没有要求等? 如果不是这样,要求如何? var injectStyles = gulp.src([ paths.tmp + '/serve/{app,components,lib}/**/*.css', paths.src + '/{app,components,lib}/**/*.css', '!' + paths.tmp + '/serve/app/vendor.css' ], {read: false}); var injectScripts = gulp.src([ paths.src + '/{app,components,lib}/**/*.js', paths.tmp + '/serve/build/*.js', '!' + paths.src + '/{app,components}/**/*.spec.js', '!' + paths.src + '/{app,components}/**/*.mock.js' ]).pipe($.angularFilesort()); var injectOptions = { […]