2016-07-25 82 views
0

我们正在从parse.com迁移到AWS。 该解决方案在本地完全正常工作,但是一旦我到eb deploy到AWS,它就无法加载云代码文件。AWS托管分析服务器无法找到云代码

Error: Cannot find module '/cloud/main.js' 
    at Function.Module._resolveFilename (module.js:325:15) 
    at Function.Module._load (module.js:276:25) 
    at Module.require (module.js:353:17) 
    at require (internal/module.js:12:17) 
    at new ParseServer (/var/app/current/node_modules/parse-server/lib/ParseServer.js:268:9) 
    at new _ParseServer (/var/app/current/node_modules/parse-server/lib/index.js:38:16) 
    at Object.<anonymous> (/var/app/current/index.js:8:11) 
    at Module._compile (module.js:409:26) 
    at Object.Module._extensions..js (module.js:416:10) 
    at Module.load (module.js:343:32) 

我的解析服务器的配置是这样的:

var api = new ParseServer({ 
    databaseURI: config.DATABASE_URI , 
    cloud: __dirname + '/cloud/main.js' , 
    appId: config.parse.APP_ID, 
    masterKey: config.parse.MASTER_KEY , 
    restApiKey: config.parse.REST_API_KEY, 
    serverURL: config.parse.SERVER_URL // Don't forget to change to https if needed 
}); 

AWS显然无法找到文件@__dirname + '/cloud/main.js' 我应该设置什么该为AWS?

回答

0

所以我刚刚删除了领先/,现在它的工作。

现在显示为cloud: 'cloud/main.js' ,

相关问题