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

deploy error when called from node #374

Closed
jescalan opened this issue Jan 11, 2013 · 9 comments
Closed

deploy error when called from node #374

jescalan opened this issue Jan 11, 2013 · 9 comments

Comments

@jescalan
Copy link

Definitely an edge case, but I thought it was worth bringing up. When I try to run jitsu deploy from a child process in node, it throws this error:

{ [Error: Command failed: 
string_decoder.js:117
  var i = (buffer.length >= 3) ? 3 : buffer.length;
                 ^
TypeError: Cannot read property 'length' of null
    at StringDecoder.detectIncompleteChar (string_decoder.js:117:18)
    at StringDecoder.write (string_decoder.js:87:28)
    at Interface._normalWrite (readline.js:296:30)
    at Interface.write (readline.js:289:49)
    at ProgressBar.tick (/usr/local/lib/node_modules/jitsu/node_modules/progress/lib/node-progress.js:114:11)
    at EventEmitter.package.updateTarball.old (/usr/local/lib/node_modules/jitsu/lib/jitsu/package.js:443:25)
    at EventEmitter.emit (events.js:88:17)
    at Timer.<anonymous> (/usr/local/lib/node_modules/jitsu/node_modules/nodejitsu-api/lib/client/client.js:185:19)
    at Timer.exports.setInterval.timer.ontimeout (timers.js:234:14)

Works fine when called directly from the command line though : )

@jamesjwood
Copy link

This is happening when running jitsu deploy as a post build task in jenkins too.

@indexzero
Copy link
Member

@blakmatrix This is an easy fix, it's just a check for process.stdout.isTTY

@blakmatrix
Copy link
Contributor

$ grep -RnHi "process.stdout.isTTY" .                                                                                                        [12:20:15]
./node_modules/.bin/vows:71:    nocolor: !process.stdout.isTTY
./node_modules/npm/lib/npm.js:297:          if (process.stdout.isTTY) npm.color = true
./node_modules/npm/node_modules/.bin/imgcat:10:  , screenWidth = process.stdout.isTTY ? process.stdout.getWindowSize()[0] : Infinity
./node_modules/npm/node_modules/ansi/examples/imgcat/index.js:10:  , screenWidth = process.stdout.isTTY ? process.stdout.getWindowSize()[0] : Infinity
./node_modules/require-analyzer/node_modules/read-installed/node_modules/npmlog/node_modules/.bin/imgcat:10:  , screenWidth = process.stdout.isTTY ? process.stdout.getWindowSize()[0] : Infinity
./node_modules/require-analyzer/node_modules/read-installed/node_modules/npmlog/node_modules/ansi/examples/imgcat/index.js:10:  , screenWidth = process.stdout.isTTY ? process.stdout.getWindowSize()[0] : Infinity
./node_modules/vows/bin/vows:71:    nocolor: !process.stdout.isTTY

@blakmatrix
Copy link
Contributor

do you guys get this when you use --raw ... also do you use --confirm ?

@blakmatrix
Copy link
Contributor

This happens when the depoy process shows a progress bar, I can make a check for tty and avoid this error when used as a child process

@talnicolas
Copy link

Happening when using jitsu deploy as an external tool in WebStorm too.

@blakmatrix
Copy link
Contributor

I made a fix for this: c00e8fe

@jescalan
Copy link
Author

Awesome! Thanks so much @blakmatrix - could you update/close this issue when it's shipped? ❤️

@blakmatrix
Copy link
Contributor

This I believe was shipped in jitsu v0.11.6 :)

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

No branches or pull requests

5 participants