我有一个使用节点 twit 模块的应用程序,可通过
npm install twit
我从 .meteor/local/build/server/ 在本地部署了节点模块
因此,它在 .meteor/local/build/server/node_modules/twit 可见
我尝试在项目根目录安装它,但项目没有找到该模块。这导致我找到了上述有效的解决方案。
我的应用程序现在在本地运行良好。我能够运行和做所有事情,并且可以根据我想要做的事情从我的 Meteor 服务器端或客户端与 Twitter 交互。没有崩溃。
当我通过命令部署到meteor.com
meteor deploy [appname] --password
应用程序部署成功。
当我尝试从浏览器访问 (app at anonistream.meteor.com)[anonistream.meteor.com] 时失败并且日志包含此错误。
[Mon May 07 2012 01:59:53 GMT+0000 (UTC)] WARNING
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Cannot find module 'twit'
at Function._resolveFilename (module.js:332:11)
at Function._load (module.js:279:25)
at Module.require (module.js:354:17)
at require (module.js:370:17)
at app/server/server.js:2:12
at /meteor/containers/84162a7c-24e8-bf26-6fd8-e4ec13b2a935/bundle/server/server.js:111:21
at Array.forEach (native)
at Function.<anonymous>
(/meteor/containers/84162a7c-24e8-bf26-6fd8- e4ec13b2a935/bundle/server/underscore.js:76:11)
at /meteor/containers/84162a7c-24e8-bf26-6fd8-e4ec13b2a935/bundle/server/server.js:97:7
[Mon May 07 2012 01:59:53 GMT+0000 (UTC)] INFO STATUS running -> waiting
[Mon May 07 2012 01:59:53 GMT+0000 (UTC)] ERROR Application crashed with code: 1
[Mon May 07 2012 02:29:55 GMT+0000 (UTC)] INFO HIT / 24.94.158.145
[Mon May 07 2012 02:29:59 GMT+0000 (UTC)] INFO HIT /favicon.ico 24.94.158.145
[Mon May 07 2012 02:30:46 GMT+0000 (UTC)] INFO HIT / 24.94.158.145
[Mon May 07 2012 02:30:50 GMT+0000 (UTC)] INFO HIT /favicon.ico 24.94.158.145
有人对如何实现这一点有任何建议吗?