2014-04-29 3 views
0

CoffeScript 용으로 tutorial을 따르려고합니다.CoffeeScript 파일을 어떻게 요구합니까?

내가 터미널을 열고 simpleMath.coffee이 존재하는 곳에 디렉토리로 이동 node를 실행하고 다음과 같은 오류가 발생하는 var SimpleMath = require('./simpleMath');을 시도 :

Error: Cannot find module 'simpleMath' 
    at Function.Module._resolveFilename (module.js:338:15) 
    at Function.Module._load (module.js:280:25) 
    at Module.require (module.js:364:17) 
    at require (module.js:380:17) 
    at repl:1:18 
    at REPLServer.self.eval (repl.js:110:21) 
    at repl.js:249:20 
    at REPLServer.self.eval (repl.js:122:7) 
    at Interface.<anonymous> (repl.js:239:12) 
    at Interface.EventEmitter.emit (events.js:95:17) 

내가 ./하지 않고,뿐만 아니라 simpleMath을 시도했다.

+1

NodeJS 문서를 보았습니까? http : //nodejs.org/api/modules.html – elclanrs

+0

물론 NODE.js에서 사용하기 전에 js로 커피를 컴파일해야합니다 .-) – andi

+0

try 'node' 대신'coffee' repl을 시작하십시오. – Bergi

답변

0

먼저 커피를 js로 컴파일해야합니다. https://github.com/oklai/koala GUI에서 파일을 캐치 및 컴파일하고 실패하면 알림을 보냅니다. 정말 좋다.

관련 문제