Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to compile web interface #147

Closed
xoseperez opened this issue May 29, 2017 · 10 comments
Closed

Unable to compile web interface #147

xoseperez opened this issue May 29, 2017 · 10 comments

Comments

@xoseperez
Copy link
Owner

Originally reported by: Sven (Bitbucket: sven-d, GitHub: Unknown)


Hi there,

I'm trying to compile the web interface as described here:
https://bitbucket.org/xoseperez/espurna/wiki/WebInterface.md

My system is Debian Jessie (8.8) on amd64. I'm trying to compile for Sonoff S20. Compiling the firmware image without web interface works like a charm, but the web interface does not compile.

Here is what I did and what the output was:

cd ~/espurna/code/
~/espurna/code$ npm install --only=dev
npm WARN package.json esp8266-filesystem-builder@0.1.0 No repository field.
npm WARN package.json esp8266-filesystem-builder@0.1.0 No README data
npm WARN deprecated gulp-clean-css@2.4.0: breaking changes from clean-css 4.x. Please install gulp-clean-css 3.x
npm WARN engine request@2.81.0: wanted: {"node":">= 4"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine clean-css@4.1.3: wanted: {"node":">= 4.0"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine form-data@2.1.4: wanted: {"node":">= 0.12"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine har-validator@4.2.1: wanted: {"node":">=4"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine hawk@3.1.3: wanted: {"node":">=0.10.32"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN engine har-schema@1.0.5: wanted: {"node":">=4"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN engine cryptiles@2.0.5: wanted: {"node":">=0.10.40"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine boom@2.10.1: wanted: {"node":">=0.10.40"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine hoek@2.16.3: wanted: {"node":">=0.10.40"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN deprecated graceful-fs@1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN engine co@4.6.0: wanted: {"iojs":">= 1.0.0","node":">= 0.12.0"} (current: {"node":"0.10.29","npm":"1.4.21"})
gulp-base64-favicon@1.0.2 node_modules/gulp-base64-favicon

del@2.2.2 node_modules/del
├── is-path-cwd@1.0.0
├── pify@2.3.0
├── object-assign@4.1.1
├── pinkie-promise@2.0.1 (pinkie@2.0.4)
├── is-path-in-cwd@1.0.0 (is-path-inside@1.0.0)
├── rimraf@2.6.1 (glob@7.1.2)
└── globby@5.0.0 (arrify@1.0.1, array-union@1.0.2, glob@7.1.2)

gulp-plumber@1.1.0 node_modules/gulp-plumber
├── through2@2.0.3 (xtend@4.0.1, readable-stream@2.2.9)
└── gulp-util@3.0.8 (array-differ@1.0.0, object-assign@3.0.0, beeper@1.1.1, lodash._reescape@3.0.0, lodash._reinterpolate@3.0.0, lodash._reevaluate@3.0.0, replace-ext@0.0.1, dateformat@2.0.0, array-uniq@1.0.3, fancy-log@1.3.0, has-gulplog@0.1.0, lodash.template@3.6.2, gulplog@1.0.0, minimist@1.2.0, chalk@1.1.3, vinyl@0.5.3, multipipe@0.1.2)

gulp@3.9.1 node_modules/gulp
├── interpret@1.0.3
├── pretty-hrtime@1.0.3
├── deprecated@0.0.1
├── archy@1.0.0
├── minimist@1.2.0
├── tildify@1.2.0 (os-homedir@1.0.2)
├── v8flags@2.1.1 (user-home@1.1.1)
├── semver@4.3.6
├── orchestrator@0.3.8 (stream-consume@0.1.0, sequencify@0.0.7, end-of-stream@0.1.5)
├── chalk@1.1.3 (escape-string-regexp@1.0.5, supports-color@2.0.0, ansi-styles@2.2.1, strip-ansi@3.0.1, has-ansi@2.0.0)
├── liftoff@2.3.0 (lodash.isstring@4.0.1, lodash.isplainobject@4.0.6, rechoir@0.6.2, flagged-respawn@0.3.2, extend@3.0.1, lodash.mapvalues@4.6.0, resolve@1.3.3, fined@1.0.2, findup-sync@0.4.3)
├── vinyl-fs@0.3.14 (strip-bom@1.0.0, graceful-fs@3.0.11, vinyl@0.4.6, mkdirp@0.5.1, through2@0.6.5, defaults@1.0.3, glob-stream@3.1.18, glob-watcher@0.0.6)
└── gulp-util@3.0.8 (array-uniq@1.0.3, beeper@1.1.1, lodash._reescape@3.0.0, lodash._reevaluate@3.0.0, lodash._reinterpolate@3.0.0, array-differ@1.0.0, object-assign@3.0.0, replace-ext@0.0.1, dateformat@2.0.0, fancy-log@1.3.0, gulplog@1.0.0, lodash.template@3.6.2, has-gulplog@0.1.0, through2@2.0.3, vinyl@0.5.3, multipipe@0.1.2)

gulp-inline@0.1.3 node_modules/gulp-inline
├── event-stream@3.3.4 (stream-combiner@0.0.4, duplexer@0.1.1, from@0.1.7, pause-stream@0.0.11, map-stream@0.1.0, split@0.3.3, through@2.3.8)
├── cheerio@0.22.0 (lodash.flatten@4.4.0, lodash.pick@4.4.0, lodash.foreach@4.5.0, lodash.assignin@4.2.0, lodash.defaults@4.2.0, lodash.bind@4.2.1, lodash.merge@4.6.0, lodash.filter@4.6.0, lodash.map@4.6.0, lodash.some@4.6.0, lodash.reject@4.6.0, lodash.reduce@4.6.0, dom-serializer@0.1.0, entities@1.1.1, css-select@1.2.0, htmlparser2@3.9.2)
├── gulp-util@3.0.8 (array-differ@1.0.0, beeper@1.1.1, lodash._reescape@3.0.0, lodash._reevaluate@3.0.0, lodash._reinterpolate@3.0.0, object-assign@3.0.0, array-uniq@1.0.3, fancy-log@1.3.0, replace-ext@0.0.1, dateformat@2.0.0, vinyl@0.5.3, chalk@1.1.3, gulplog@1.0.0, lodash.template@3.6.2, has-gulplog@0.1.0, minimist@1.2.0, multipipe@0.1.2)
└── through2@2.0.3 (xtend@4.0.1, readable-stream@2.2.9)

gulp-gzip@1.4.0 node_modules/gulp-gzip
├── stream-to-array@1.0.0
├── bytes@0.3.0
├── through2@0.4.2 (xtend@2.1.2, readable-stream@1.0.34)
└── gulp-util@2.2.20 (lodash._reinterpolate@2.4.1, minimist@0.2.0, vinyl@0.2.3, chalk@0.5.1, lodash.template@2.4.1, through2@0.5.1, dateformat@1.0.12, multipipe@0.1.2)

gulp-useref@3.1.2 node_modules/gulp-useref
├── useref@1.2.0
├── is-relative-url@1.0.0 (is-absolute-url@1.0.0)
├── event-stream@3.3.4 (stream-combiner@0.0.4, duplexer@0.1.1, from@0.1.7, pause-stream@0.0.11, map-stream@0.1.0, split@0.3.3, through@2.3.8)
├── glob@7.1.2 (path-is-absolute@1.0.1, inherits@2.0.3, fs.realpath@1.0.0, inflight@1.0.6, once@1.4.0, minimatch@3.0.4)
├── through2@2.0.3 (xtend@4.0.1, readable-stream@2.2.9)
├── gulp-util@3.0.8 (array-differ@1.0.0, beeper@1.1.1, lodash._reinterpolate@3.0.0, lodash._reevaluate@3.0.0, lodash._reescape@3.0.0, array-uniq@1.0.3, object-assign@3.0.0, dateformat@2.0.0, fancy-log@1.3.0, has-gulplog@0.1.0, replace-ext@0.0.1, gulplog@1.0.0, lodash.template@3.6.2, chalk@1.1.3, vinyl@0.5.3, minimist@1.2.0, multipipe@0.1.2)
├── gulp-concat@2.6.1 (vinyl@2.0.2, concat-with-sourcemaps@1.0.4)
└── vinyl-fs@2.4.4 (object-assign@4.1.1, vali-date@1.0.0, is-valid-glob@0.3.0, merge-stream@1.0.1, graceful-fs@4.1.11, lodash.isequal@4.5.0, lazystream@1.0.0, strip-bom@2.0.0, strip-bom-stream@1.0.0, gulp-sourcemaps@1.6.0, duplexify@3.5.0, mkdirp@0.5.1, through2-filter@2.0.0, glob-stream@5.3.5, vinyl@1.2.0, readable-stream@2.2.9)

gulp-if@2.0.2 node_modules/gulp-if
├── gulp-match@1.0.3 (minimatch@3.0.4)
├── ternary-stream@2.0.1 (fork-stream@0.0.4, duplexify@3.5.0, merge-stream@1.0.1)
└── through2@2.0.3 (xtend@4.0.1, readable-stream@2.2.9)

gulp-clean-css@2.4.0 node_modules/gulp-clean-css
├── object-assign@4.1.1
├── through2@2.0.3 (xtend@4.0.1, readable-stream@2.2.9)
├── vinyl-sourcemaps-apply@0.2.1 (source-map@0.5.6)  
├── gulp-util@3.0.8 (object-assign@3.0.0, beeper@1.1.1, lodash._reescape@3.0.0, lodash._reinterpolate@3.0.0, lodash._reevaluate@3.0.0, array-differ@1.0.0, has-gulplog@0.1.0, array-uniq@1.0.3, replace-ext@0.0.1, dateformat@2.0.0, fancy-log@1.3.0, lodash.template@3.6.2, vinyl@0.5.3, gulplog@1.0.0, chalk@1.1.3, minimist@1.2.0, multipipe@0.1.2)
└── clean-css@4.1.3 (source-map@0.5.6)

gulp-uglify@1.5.4 node_modules/gulp-uglify
├── uglify-save-license@0.4.1
├── deap@1.0.0
├── isobject@2.1.0 (isarray@1.0.0)
├── fancy-log@1.3.0 (time-stamp@1.1.0, chalk@1.1.3)  
├── gulp-util@3.0.8 (array-differ@1.0.0, beeper@1.1.1, lodash._reescape@3.0.0, lodash._reevaluate@3.0.0, lodash._reinterpolate@3.0.0, array-uniq@1.0.3, object-assign@3.0.0, dateformat@2.0.0, replace-ext@0.0.1, minimist@1.2.0, lodash.template@3.6.2, gulplog@1.0.0, vinyl@0.5.3, has-gulplog@0.1.0, chalk@1.1.3, multipipe@0.1.2)
├── through2@2.0.3 (xtend@4.0.1, readable-stream@2.2.9)
├── vinyl-sourcemaps-apply@0.2.1 (source-map@0.5.6)  
└── uglify-js@2.6.4 (uglify-to-browserify@1.0.2, async@0.2.10, yargs@3.10.0, source-map@0.5.6)

gulp-htmlmin@2.0.0 node_modules/gulp-htmlmin
├── tryit@1.0.3
├── object-assign@4.1.1
├── bufferstreams@1.1.1
├── readable-stream@2.2.9 (buffer-shims@1.0.0, process-nextick-args@1.0.7, util-deprecate@1.0.2, core-util-is@1.0.2, isarray@1.0.0, inherits@2.0.3, string_decoder@1.0.1)
├── gulp-util@3.0.8 (array-differ@1.0.0, object-assign@3.0.0, beeper@1.1.1, lodash._reinterpolate@3.0.0, lodash._reescape@3.0.0, lodash._reevaluate@3.0.0, array-uniq@1.0.3, replace-ext@0.0.1, dateformat@2.0.0, fancy-log@1.3.0, has-gulplog@0.1.0, vinyl@0.5.3, minimist@1.2.0, gulplog@1.0.0, lodash.template@3.6.2, chalk@1.1.3, through2@2.0.3, multipipe@0.1.2)
└── html-minifier@2.1.7 (ncname@1.0.0, relateurl@0.2.7, he@1.1.1, commander@2.9.0, change-case@3.0.1, clean-css@3.4.26, uglify-js@2.6.4)

gulp-css-base64@1.3.4 node_modules/gulp-css-base64   
├── buffers@0.1.1
├── mime@1.3.6
├── async@1.5.2
├── chalk@1.1.3 (escape-string-regexp@1.0.5, supports-color@2.0.0, ansi-styles@2.2.1, strip-ansi@3.0.1, has-ansi@2.0.0)
├── through2@2.0.3 (xtend@4.0.1, readable-stream@2.2.9)
├── gulp-util@3.0.8 (array-differ@1.0.0, beeper@1.1.1, lodash._reinterpolate@3.0.0, lodash._reescape@3.0.0, lodash._reevaluate@3.0.0, object-assign@3.0.0, array-uniq@1.0.3, replace-ext@0.0.1, dateformat@2.0.0, fancy-log@1.3.0, gulplog@1.0.0, lodash.template@3.6.2, has-gulplog@0.1.0, minimist@1.2.0, vinyl@0.5.3, multipipe@0.1.2)
└── request@2.81.0 (is-typedarray@1.0.0, oauth-sign@0.8.2, aws-sign2@0.6.0, forever-agent@0.6.1, tunnel-agent@0.6.0, stringstream@0.0.5, caseless@0.12.0, isstream@0.1.2, json-stringify-safe@5.0.1, performance-now@0.2.0, safe-buffer@5.0.1, extend@3.0.1, aws4@1.6.0, uuid@3.0.1, combined-stream@1.0.5, qs@6.4.0, form-data@2.1.4, mime-types@2.1.15, tough-cookie@2.3.2, hawk@3.1.3, http-signature@1.1.1, har-validator@4.2.1)

~/espurna/code$ node node_modules/gulp/bin/gulp.js

/home/buildd/espurna/code/node_modules/gulp-inline/index.js:155
        for (var p of process) {
                   ^^
SyntaxError: Unexpected identifier
    at Module._compile (module.js:439:25)
    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)
    at require (module.js:380:17)
    at Object.<anonymous> (/home/buildd/espurna/code/gulpfile.js:36:16)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
~/espurna/code$

Did I do anything wrong?

Thanks for any hint!
Sven

@xoseperez
Copy link
Owner Author

Original comment by Sven (Bitbucket: sven-d, GitHub: Unknown):


I just noticed that the data/index.html.gz file is generated even if I don't run the

npm install --only=dev
node node_modules/gulp/bin/gulp.js

commands, so I guess these commands are not neccessary any more.

Thanks,
Sven

@xoseperez
Copy link
Owner Author

With the lastest versions of the firmware the "data/index.html.gz" is not used anymore, instead a "static/index.html.gz.h" file is generated and included in the main firmware image.

If you don't want to do changes on the web interface you can simply use the file included in the repo. But to recreate that file you still need to use gulp.

@xoseperez
Copy link
Owner Author

What version of node.js are you using? I have test it with 4.6.0, 6.11.1 and 8.1.4 with no problems...

@xoseperez
Copy link
Owner Author

Any update on this?

@xoseperez
Copy link
Owner Author

Original comment by Sven (Bitbucket: sven-d, GitHub: Unknown):


Sorry for the delayed response.
I use the packages from Debian's repository, "npm" is version "1.4.21+ds-2", "nodejs" is version "0.10.29~dfsg-2".

@xoseperez
Copy link
Owner Author

Try running node with the --harmony flag:

node node_modules/gulp/bin/gulp.js --harmony

@xoseperez
Copy link
Owner Author

Original comment by Sven (Bitbucket: sven-d, GitHub: Unknown):


Thanks for your help, but that throws another error:

#!arduino

~/espurna/code$ node node_modules/gulp/bin/gulp.js --harmony
[12:33:39] Node flags detected: --harmony
[12:33:39] Respawned to PID: 29308

/home/buildd/espurna/code/node_modules/gulp-clean-css/index.js:30
    let pass = {[file.path]: {styles: contents}};
                ^
SyntaxError: Unexpected token [
    at Module._compile (module.js:439:25)
    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)
    at require (module.js:380:17)
    at Object.<anonymous> (/home/buildd/espurna/code/gulpfile.js:29:18)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)

@xoseperez
Copy link
Owner Author

Try upgrading nodejs to 4.6.
I use "nvm" (https://github.com/creationix/nvm) to manage nodejs versions, it rocks.

@xoseperez
Copy link
Owner Author

Original comment by Sven (Bitbucket: sven-d, GitHub: Unknown):


I have created a Debian Stretch chroot and installed npm 1.4.21+ds-2 and nodejs 4.8.2~dfsg-1.

After also installing node-through2 and node-gulp-util, it compiles without problems.

Thanks for your help!

@xoseperez
Copy link
Owner Author

Great
I have added a reference to this ticket in the docs for future reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant