node.js - Error with Simple Express Server and Gulp -
i'm trying run simple express web server using gulp task. want static server displays index file. can perform running node module, again, want in gulp. plan on expanding allow livereload server set up.
i have followed many tutorials on setting livereload failing. i'm assuming has versions being used respect when articles written. hoping maybe had idea on how handle this.
i have created small github repo allows play around i'm trying accomplish: fixit
gulpfile.js:
var gulp = require('gulp'); var express_port = 4000; var express_root = __dirname; gulp.task('express', function () { var express = require('express'); var app = express(); app.use(express.static(express_root)); app.listen(express_port); });
*there index.html
in same directory gulpfile
and here error:
/var/www/clients/client1/web14/sendus-admin/node_modules/express/node_modules/etag/index.js:55 throw new typeerror('argument entity must string or buffer') ^ typeerror: argument entity must string or buffer @ etag (/var/www/clients/client1/web14/sendus-admin/node_modules/express/node_modules/etag/index.js:55:11) @ sendstream.setheader (/var/www/clients/client1/web14/sendus-admin/node_modules/express/node_modules/send/index.js:724:15) @ sendstream.send (/var/www/clients/client1/web14/sendus-admin/node_modules/express/node_modules/send/index.js:500:8) @ onstat (/var/www/clients/client1/web14/sendus-admin/node_modules/express/node_modules/send/index.js:585:10) @ object.oncomplete (fs.js:97:15)
i had same problem , after week without gulp , browsersync working (the combination giving me same error), resorted more severe options reinstalling node.js. in end, worked me use nvm downgrade node.js version 10 (i using 11 before).
nvm install 0.10 nvm use 0.10
then updated , used gulp:
npm update gulp
sure hope helps too.
Comments
Post a Comment