2013-11-27 16 views
2

我有一個用express,node,socket io和coffeescript編寫的js web應用程序。我試圖讓本地服務器在本地機器上啓動。意外的字符串錯誤要求在JS應用程序文件中找不到快捷方式

我去了包含package.json文件的目錄並運行npm install來安裝包含express的所有依賴關係。

當我運行npm list我在那裏看到express

當我嘗試啓動

node app.coffee的應用程序,其中app.coffee位於

目錄內的給了我這個錯誤

exports, require, module, __filename, __dirname) { express = require 'express' 
                    ^^^^^^^^^ 
SyntaxError: Unexpected string 
    at Module._compile (module.js:439:25) 
    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:901:3 

我確信我這樣做有節點

which node我在我的機器上安裝了咖啡腳本

sudo npm install -g coffee-script

我甚至嘗試

coffee app.coffee

我不知道還有什麼我需要檢查。 app.coffee位於我的nodejs文件夾中。

回答

5

只需運行

coffee app.coffee -n 

你可以找到更多信息here

相關問題