Compiling CoffeeScript with You
I am actually trying to recompile the CoffeeScript compiler made in CoffeeScript from the github repository, but I am unable to recompile a single coffee source file.
I tried to install the compiler coffee
with npm
, but it gives me a command coffee
that does it when I try to run:
coffee src/lexer.coffee
Or:
coffee -c src/lexer.coffee
Error: in lexer.coffee, Parse error on line 115: Unexpected "..."
in Object.parseError (/ usr / lib / coffee-script / lib / coffee-script / parser.js: 477: 11)
on .. .
[Long stacktrace here]
So how can I try to run directly the compiler present in the github repository? When I try to run the scripts of the executables bin/coffee
or bin/cake
even in root mode or using nodeJS they print nothing and return 1.
source to share
AND
When I try to run scripts on executable files
bin/coffee
orbin/cake
even in root mode or with node JS, they print nothing and return 1.
and
coffee -v
andnode -v
both print nothing and still return 1. Same thing when I go to the cloned coffeescript repository and try to run./bin/coffee -v
Indicate that nodejs is not installed correctly. (Or at least not set as coffeescript expects). On some Linux installations, another application might be installed like node
, and this might conflict with scripts that expect node
nodejs to be. See related question: nodejs vs node on ubuntu 12.04
source to share
Are you missing cake ? If you look at the source, CoffeeScript is used cake
as a build tool.
If I am missing something, the instructions in the README are not accurate with regards to creating the project.
I managed to build the compiler by following these steps:
- Clone the CoffeeScript report.
- Run the
npm install
CoffeeScript replica from the root to install the required dependencies. - Install cake:
npm install cake
(I personally hate disliking global installs, so I always just set deps local to the project.) - Assemble the cake:
./node_modules/.bin/cake build
- If there is no error, make sure the tests passed:
./node_modules/.bin/cake test
- Profit!
I'm opening the PR right now to update these instructions in the README.
EDIT: A PR was opened for this: https://github.com/jashkenas/coffeescript/pull/4031
source to share