bevry / cson

CoffeeScript-Object-Notation. Same as JSON but for CoffeeScript objects.
Other
1.34k stars 56 forks source link

cson installed on MacOSX doesn't work #48

Closed mocheng closed 10 years ago

mocheng commented 10 years ago

In MacOS 10.9.4, install cson by npm install cson@1.61.

Test code:

var CSON = require('cson');

CSON.parse('data.cson', function(err, cson) {
    console.log(cson);
});

It outputs

undefined:1
TRY = 89, TYPEOF = 90, VAR = 91, VOID = 92, YIELD = 93, WHILE = 94, WITH = 95;
                                                                    ^^^^
SyntaxError: Module 'WITH' used improperly
  at /private/tmp/node_modules/cson/node_modules/js2coffee/out/lib/narcissus_packed.js:383:21
  at Object.<anonymous> (/private/tmp/node_modules/cson/node_modules/js2coffee/out/lib/narcissus_packed.js:832:2)
  at Module._compile (module.js:456:26)
  at Object.Module._extensions..js (module.js:474:10)
  at Module.load (module.js:356:32)
  at Function.Module._load (module.js:312:12)
  at Module.require (module.js:364:17)
  at require (module.js:380:17)
  at Object.<anonymous> (/private/tmp/node_modules/cson/node_modules/js2coffee/out/lib/js2coffee.js:9:12)
  at Object.<anonymous> (/private/tmp/node_modules/cson/node_modules/js2coffee/out/lib/js2coffee.js:1157:4)
  at Module._compile (module.js:456:26)
  at Object.Module._extensions..js (module.js:474:10)
  at Module.load (module.js:356:32)
  at Function.Module._load (module.js:312:12)
  at Module.require (module.js:364:17)
  at require (module.js:380:17)
  at Object.<anonymous> (/private/tmp/node_modules/cson/out/lib/cson.js:7:15)
  at Object.<anonymous> (/private/tmp/node_modules/cson/out/lib/cson.js:144:4)
  at Module._compile (module.js:456:26)
  at Object.Module._extensions..js (module.js:474:10)
  at Module.load (module.js:356:32)
  at Function.Module._load (module.js:312:12)
  at Module.require (module.js:364:17)
  at require (module.js:380:17)
  at Object.<anonymous> (/private/tmp/test.js:1:74)
  at Module._compile (module.js:456:26)
  at Object.Module._extensions..js (module.js:474:10)
  at Module.load (module.js:356:32)
  at Function.Module._load (module.js:312:12)
  at Function.Module.runMain (module.js:497:10)
  at startup (node.js:119:16)
  at node.js:906:3

Curiously, same version cson works in Linux.

And, if I copy cson package installed in Linux over to Mac. It still works.

It just cannot get properly installed in Mac.

RobLoach commented 10 years ago

What version of npm are you on? Remove ~/.npm and re-try? Sometimes the cache messes up.

mocheng commented 10 years ago

Even reinstall node doesn't get it work.

This seems a known issue for js2coffee.

mocheng commented 10 years ago

My bad. It is due to my local setting alias node="node --harmony".