Tag: 浏览器同步

Laravel-mix – BrowserSync在event.js上抛出错误:160

不知道这个问题是否与laravel-mix相关,但是我对Browsersync软件包有问题。 这是我的mix.js: mix.js('resources/assets/js/app.js', 'public/js') .browserSync({proxy: 'localhost:8000'}) .sass('resources/assets/sass/app.scss', 'public/css'); 当我运行npm run watch-poll ( watch不接受更改,因此watch-poll 在这里看到 )我在控制台上得到以下错误: [Browsersync] Watching files… events.js:160 throw er; // Unhandled 'error' event ^ Error: watch resources/views/auth/passwords ENOSPC at exports._errnoException (util.js:1020:11) at FSWatcher.start (fs.js:1443:19) at Object.fs.watch (fs.js:1470:11) at createFsWatchInstance (/home/tanmay/LVProjects/learningdemo/node_modules/chokidar/lib/nodefs-handler.js:37:15) at setFsWatchListener (/home/tanmay/LVProjects/learningdemo/node_modules/chokidar/lib/nodefs-handler.js:80:15) at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/tanmay/LVProjects/learningdemo/node_modules/chokidar/lib/nodefs-handler.js:228:14) at FSWatcher.NodeFsHandler._handleDir (/home/tanmay/LVProjects/learningdemo/node_modules/chokidar/lib/nodefs-handler.js:407:19) at FSWatcher.<anonymous> (/home/tanmay/LVProjects/learningdemo/node_modules/chokidar/lib/nodefs-handler.js:455:19) at […]

Gulp在我的macOS上没有成功运行

My Advanced Gulp Workflow for WordPress Themes 我正在学习本教程,并使用他在教程中提供的gulfile.js,但是当我安装 npm install 我收到了很多问题,所以我更新了文件。 但是当我实例化 glup 在我的macOSterminal,它给了我下面的错误,并拒绝成功运行命令。 [Browsersync] Serving files from: ./ [Browsersync] Watching files… [23:36:59] gulp-notify: [Gulp notification] Custom scripts task complete [23:36:59] Finished 'scriptsJs' after 388 ms [23:36:59] gulp-notify: [Gulp notification] Vendor scripts task complete [23:36:59] Finished 'vendorsJs' after 405 ms [23:36:59] Starting 'default'… [23:36:59] Finished […]

使用gulp时,Css样式表有错误的path

我一直在挣扎一段时间,坦白地说,这是相当令人沮丧的。 问题: 我为我的静态网站创build了一个gulp文件,我所要做的就是使用browserSync,将sass编译为css,并将脚本和css文件缩小。 一切工作正常,排除一件事情: 当我运行“gulp”时,除了位于“CSS /”中的de css文件外,所有的东西都会被加载。 显然服务器认为css文件实际上是(“CSS / style.css /”)文件夹。 控制台错误的屏幕截图: 图像 该css文件位于“css / style.css” "use strict"; let paths = { script: "js/*.js", minifiedScript: 'script.min.js', cssPath: "css/*.css", productionFolder: "production", sassPath: "scss/*.scss", htmlFiles: "*.html" }; const gulp = require('gulp'); const concat = require('gulp-concat'); const uglify = require('gulp-uglify'); const sourcemaps = require('gulp-sourcemaps'); const del = require('del'); […]

nmp ubuntu错误权限被拒绝

我尝试安装浏览器同步,但我不断收到此错误: terkea@terkea-Lenovo-G50-80:~$ npm install -g browser-sync npm WARN deprecated express@2.5.11: express 2.x series is deprecated npm WARN deprecated connect@1.9.2: connect 1.x series is deprecated npm WARN checkPermissions Missing write access to /usr/lib/node_modules/browser-sync npm WARN checkPermissions Missing write access to /usr/lib/node_modules/browser-sync/node_modules npm WARN checkPermissions Missing write access to /usr/lib/node_modules npm ERR! path /usr/lib/node_modules/browser-sync npm ERR! code […]

与浏览器同步和代理服务器抛出错误的Gulp PHP

在Windows 10升级/重置后,我不得不重新下载我所有的开发工具。我似乎无法让我的服务器与gulp-connect-php,gulp-browser-sync和http-proxy一起工作。 下面的任务实际上是从这个答案: Gulp-webapp运行BrowserSync和PHP 。 这是来自Yeoman的一代gulp-webapp。 常规的“服务”工程,但当然不会启动PHP文件。 在升级之前,我已经使用了它,但是现在,当我尝试启动URL时,http-proxy错误与ECONNREFUSED一起出现。 请注意,它不会错误,直到我实际上去的URL,如果任务设置为不自动打开浏览器,它不会错误,直到我去localhost:3000。 任何想法这个错误的原因? 吞噬任务 gulp.task('php-serve', ['styles', 'fonts'], () => { phpConnect.server({ port: 9001, base: 'app', open: false }); const proxy = httpProxy.createProxyServer({}); browserSync({ notify: false, open: false, port: 9000, server: { baseDir: ['.tmp', 'app'], routes: { '/bower_components': 'bower_components' }, middleware: function (req, res, next) { var url = […]

使用npm通过package.json调用Harp和浏览器同步

我想推荐一种方法来启动一个harp.js服务器,并同时运行浏览器同步过程。 它在Linux上像一个魅力工作。 这是我的package.json的内容 { "scripts": { "dev": "bash ./serve.sh" } } 这是serve.sh #!/bin/bash harp server & browser-sync start –proxy 'localhost:9000' –files '*.jade, *.less' 当在Windows上这样做,我应该做一个bat文件,我认为,但没有一种方法来转换竖琴服务器和浏览器同步等等等相应的命令在Windows上?

Gulp.js浏览器同步不会重新加载我的浏览器

Gulp浏览器同步不会重新加载我的浏览器。 当我点击保存我的项目时,它生成一切正常。 我的浏览器闪烁,并在右上angular显示“连接到浏览器同步”。 它不会加载更改。 当我手动刷新刷新时,它会加载更改。 我一直在咕噜咕噜的文件,并没有发现任何错误。 有什么build议? Gulp.js文件: var $ = require('gulp-load-plugins')(); var argv = require('yargs').argv; var browser = require('browser-sync'); var gulp = require('gulp'); var panini = require('panini'); var rimraf = require('rimraf'); var sequence = require('run-sequence'); var sherpa = require('style-sherpa'); // Check for –production flag var isProduction = !!(argv.production); // Port to use for the […]

Gulp Serve:为所有path渲染index.html

我正在运行一个简单的AngularJS应用程序,并使用浏览器同步使用Gulp / Gulp服务。 为了使我的Angular路线工作,我需要为端口上的所有path渲染/index.html 。 我该怎么做呢? 我目前的代码是: gulp.task('serve', ['less'], function() { browserSync.init({ server: "./app" }); gulp.watch("app/css/*.less", ['less']); gulp.watch("app/*.html").on('change', browserSync.reload); gulp.watch("app/js/**/*.js").on('change', browserSync.reload); });

浏览器与gulp和Ghost博客同步

我正在运行一个Ghost博客,这个博客只是以npm start 然后运行在http://lolcahost:2368 我有浏览器同步设置运行在我的gulpfile像这样: gulp.task('default', function() { browserSync.init(null, { server: { proxy: 'http://localhost:2368' } }); }); 虽然没有看到工作。 它在我的浏览器上启动localhost:3000但只是在完全空白的白页上显示一条消息: Cannot GET / 我在这里做错了什么? 当我访问Ghost创build的localhost:2368 ,我可以看到这个网站很好。

为什么后续的HTTP请求

我的JavaScript使那个检索JSON数组的ajax调用。 我试图模拟长时间运行的HTTP REST调用请求,需要更长的时间才能返回结果。 我这样做是延迟写入任何东西到服务器端的响应对象,直到请求到达5分钟后。 之后,我将状态设置为200,并用JSON结束stream写入响应。 在服务端放置一个断点,我意识到请求显示第二次,但浏览器的networking选项卡不显示另一个请求。 它可能不相关,但我使用browsersync middlewars来服务这个JSON,并写入字节,并在setTimeout()结束响应。 setTimeout(()=> { res.statusCode = 200; res.write(data); res.end(); }); 题: 任何人有任何解释为什么发生这种情况? 如果有一种方法来模拟另一种方式呢?