2012-10-02 66 views
0

我安裝了最新的express-coffee並且安裝了node-config。我創建了一個簡單的src /配置/ default.yamlnode.js express-coffee錯誤:ENOENT,沒有這樣的文件或目錄

Database: 
    db_host: localhost 
    db_name: test 

在我的src /模型/ index.coffee

config = require('config').Database 

console.log "host: #{config.db_host}" 

但是,試圖與cake dev甚至cake build && node app我正在啓動服務器時,以下錯誤:

Cannot write runtime.json file Error: ENOENT, no such file or directory 

試圖在這裏和谷歌搜索問題,但無法找到任何東西。即使只是ENOENT或node-config runtime.json上的少量命中也沒有幫助。任何人都遇到過這個問題?

回答

0

原來問題出在config/default.yaml所在的位置。我必須將其移至應用程序的根目錄。將它移動到root - config/default.yaml修復了這個問題。 錯誤消息在確定發生了什麼並不是很有幫助。

相關問題