cson icon indicating copy to clipboard operation
cson copied to clipboard

unknown conversion error

Open aminya opened this issue 5 years ago • 5 comments

I have installed cson on Windows globally using npm install --global cson, but I get an unknown conversion error when I try to run the commands from Powershell:

> cson2json in.cson > out.json
Unknown conversion

> cat in.cson | cson2json > out.json
Unknown conversion

aminya avatar Dec 29 '19 22:12 aminya

Can you debug on your side? I don't have windows so I cannot test.

To debug follow the contributing.md instructions and run npm link to expose the bins globally.

balupton avatar Dec 30 '19 08:12 balupton

It looks like the command name isn't being sent along in process.argv:

[
  'C:\\Program Files\\nodejs\\node.exe',
  'C:\\Users\\redacted\\Projects\\redacted\\node_modules\\cson\\bin.js',
  'path/to/file.cson'
]

I tried forcing the issue by using npx cson2json cson2json path/to/file.cson, but then process.argv.length equals 4 and boots me to the if-block that prints usage information.

mattacosta avatar Jan 10 '20 04:01 mattacosta

I think I'm going to go back to using two seperate cli files, instead of the merging of one.

balupton avatar Oct 28 '20 22:10 balupton

I'm experiencing the same issue. So far I have to manually edit cson/edition-esnext/bin.js to use the parser.

sigod avatar Apr 22 '21 22:04 sigod

This was fixed in #136, but it was never merged. You can use that fork instead.

aminya avatar Apr 23 '21 06:04 aminya