Originally created by: jvanharn
During the downloading of a binary for Node-sass it displays an "gauge", it however does not take into account the capabilities of the terminal. (E.g. if it can show a gauge).
It only occurs when:
* You do not already have a binary in your cache (Because the gauge is not shown if you have it cached)
* You run npm install (and thus the node-sass install script) in a console-like tty without color etc, or by using the reproduction case below, where the stdout is diverted.
Exerpt from the generated error:
> node-sass@4.9.0 install /home/jeffrey/projects/sheva/libraries/angular/i18n/node_modules/node-sass > node scripts/install.js Downloading binary from https://github.com/sass/node-sass/releases/download/v4.9.0/linux-x64-57_binding.node /home/jeffrey/projects/sheva/libraries/angular/i18n/node_modules/gauge/render-template.js:67 throw new error.MissingTemplateValue(cloned, values) ^ Error: Missing template value "progressbar" at cloneAndObjectify (/home/jeffrey/projects/sheva/libraries/angular/i18n/node_modules/gauge/render-template.js:67:17) at Array.map (<anonymous>) at prepareItems (/home/jeffrey/projects/sheva/libraries/angular/i18n/node_modules/gauge/render-template.js:83:25) at module.exports (/home/jeffrey/projects/sheva/libraries/angular/i18n/node_modules/gauge/render-template.js:16:15) at module.exports.Plumbing.show (/home/jeffrey/projects/sheva/libraries/angular/i18n/node_modules/gauge/plumbing.js:45:10) at Gauge._doRedraw (/home/jeffrey/projects/sheva/libraries/angular/i18n/node_modules/gauge/index.js:226:40) at Timeout.<anonymous> (/home/jeffrey/projects/sheva/libraries/angular/i18n/node_modules/gauge/index.js:15:19) at ontimeout (timers.js:482:11) at Timer.unrefdHandle (timers.js:595:5)
Only show "gauge" during downloading if terminal/tty supports it, like npm does.
In a project with node-sass 4.9.0 as a dependency, launch npm install in a simple tty or with diverted stdout/stderr. Without a locally cached copy of the binary.
npm cache clear --force npm install --no-save 2> >(grep --color=always -v "SKIPPING OPTIONAL DEPENDENCY" 1>&2)
Switch out your CI-system with one that supports a full tty, and or (when working locally) dont divert the TTY, e.g. dont pipe the output of npm install generally.
npm -v
): 6.0.0
node -v
): 8.11.1
Node Process (node -p process.versions
):
:::js
{ http_parser: '2.8.0',
node: '8.11.1',
v8: '6.2.414.50',
uv: '1.20.2',
zlib: '1.2.11',
ares: '1.13.0',
modules: '57',
nghttp2: '1.31.0',
openssl: '1.1.0g',
icu: '61.1',
unicode: '10.0',
cldr: '33.0',
tz: '2018c' }
- Node Platform (node -p process.platform
): linux
- Node architecture (node -p process.arch
): x64
- node-sass version (node -p "require('node-sass').info"
): n.a.
- npm node-sass versions (npm ls node-sass
): n.a.
Originally posted by: xzyfer
Thanks for the report. I've heard node has an istty flag but I'm not sure
the reliability of it is.
On Mon., 7 May 2018, 4:41 pm J. van Harn, notifications@github.com wrote:
Originally posted by: nschonni
I thought we resolved this on our side with https://github.com/sass/node-sass/commit/d83ebc8b5de5af389e8a305727b91ebee2b4d669
Originally posted by: nschonni
Looks like we also tie into the NPM config here https://github.com/sass/node-sass/blob/b4f82d806cbc6796a03c3b266cee5463d2a5b0e4/scripts/install.js#L73-L85