santinic / how2

AI for the Command Line
https://how2terminal.com
MIT License
5.72k stars 156 forks source link

"SyntaxError: Unexpected token <" when pressing space #39

Closed danqing closed 2 months ago

danqing commented 8 years ago

Does how2 require a min version of node?

I did how2 scp from remote, and then pressed Space:

$how2 scp from remote
scp - How to copy a file from remote server to local machine?

The syntax for scp is:

If you are on the computer from which you want to send file to a remote computer:

   scp /file/to/send username@remote:/where/to/put

Here the remote can be a FQDN or an IP address.

On the other hand if you are on the computer wanting to receive file from a remote computer:

   scp username@remote:/file/to/send /where/to/put

scp can also send files between two remote hosts:

   scp username@remote_1:/file/to/send username@remote_2:/where/to/put

So the basic syntax is:

   scp username@source:/location/to/file username@destination:/where/to/put

You can read man scp (http://linux.die.net/man/1/scp) to get more idea on this.

Press SPACE for more choices, any other key to quit.
SyntaxError: Unexpected token <
    at Object.parse (native)
    at Request._callback (/Users/danqing/.nvm/v0.10.32/lib/node_modules/how2/node_modules/npm-latest/lib/npm-latest.js:49:23)
    at Request.self.callback (/Users/danqing/.nvm/v0.10.32/lib/node_modules/how2/node_modules/request/request.js:199:22)
    at Request.emit (events.js:98:17)
    at Request.<anonymous> (/Users/danqing/.nvm/v0.10.32/lib/node_modules/how2/node_modules/request/request.js:1036:10)
    at Request.emit (events.js:117:20)
    at IncomingMessage.<anonymous> (/Users/danqing/.nvm/v0.10.32/lib/node_modules/how2/node_modules/request/request.js:963:12)
    at IncomingMessage.emit (events.js:117:20)
    at _stream_readable.js:943:16
    at process._tickCallback (node.js:419:13)
Hammster commented 8 years ago

Pull request #38 covers this issue, you need Node.js v4.0.0^ because of a string written in ES6 convention at the moment, but i think it will be resolved.

santinic commented 8 years ago

@Hammster This is a different issue. npm-latest got some weird json to parse from npmjs.org while trying to fetch if there is a new version from how2. ES6 is only in the tests.

@danqing does it still happen ? did you try again ? I might just try-catch that bit.

Hammster commented 8 years ago

@santinic Whoopsie daisy, i should've read it twice! :smile: