node-wp-cli icon indicating copy to clipboard operation
node-wp-cli copied to clipboard

SyntaxError: Unexpected end of input

Open desaiuditd opened this issue 9 years ago • 4 comments

I get this error when trying to execute WP.discover command.

I tried it on Linux as well as Mac environment.

node-wp-cli version: 0.0.4

Following is the output log.

Mac

undefined:1
ription":"List all sites in a multisite install.","longdesc":"## OPTIONS\n\n[-

SyntaxError: Unexpected end of input
    at Object.parse (native)
    at /Users/udit/easyengine-vagrant/www/Data/generator-moxie-wp/node_modules/wp-cli/lib/commands.js:17:20
    at ChildProcess.exithandler (child_process.js:758:5)
    at ChildProcess.emit (events.js:110:17)
    at maybeClose (child_process.js:1015:16)
    at Process.ChildProcess._handle.onexit (child_process.js:1087:5)

Linux

undefined:1
d more than once)\n\n  --[no-]color\n      Whether to colorize the output\n\n 

SyntaxError: Unexpected end of input
    at Object.parse (native)
    at /var/www/Data/generator-moxie-wp/node_modules/wp-cli/lib/commands.js:17:20
    at ChildProcess.exithandler (child_process.js:758:5)
    at ChildProcess.emit (events.js:110:17)
    at maybeClose (child_process.js:1015:16)
    at Process.ChildProcess._handle.onexit (child_process.js:1087:5)

desaiuditd avatar Apr 29 '15 08:04 desaiuditd

I have the same problem. Is it already fixed?

thiagolcks avatar Jun 19 '15 14:06 thiagolcks

looks like it still needs to be updated on npm.

thorstenweber83 avatar Jun 19 '15 14:06 thorstenweber83

bumped - I clearly just needed some peer pressure (it's updated)

gtg092x avatar Jun 19 '15 16:06 gtg092x

I'm having this same issue in the event that wp-cli is not installed locally. it appears in the event of wp cli not being installed, stdout in commands.js is blank which is causing a json parse error.

SyntaxError: Unexpected end of input
    at Object.parse (native)
    at %Package_Path%/node_modules/wp-cli/lib/commands.js:13:19
    at ChildProcess.exithandler (child_process.js:232:5)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at maybeClose (internal/child_process.js:818:16)
    at Socket.<anonymous> (internal/child_process.js:319:11)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at Pipe._onclose (net.js:469:12)

peterjohnhunt avatar Aug 01 '16 17:08 peterjohnhunt