我按照http://meteorhacks.com/complete-npm-integration-for-meteor.html上的指南了解如何将 npm 包与流星一起使用。现在我有这个
包.json
{
"node-xmpp": "0.10.0"
}
服务器.js
var xmpp = Npm.require('node-xmpp');
.meteor/包
standard-app-packages
accounts-ui
accounts-github
insecure
accounts-base
accounts-password
npm
但是当我运行服务器 W20 时,我不断得到这个
140608-11:58:32.132(-4)? (STDERR) Error: Cannot find module 'node-xmpp'
W20140608-11:58:32.132(-4)? (STDERR) at Function.Module._resolveFilename (module.js:338:15)
W20140608-11:58:32.132(-4)? (STDERR) at Function.Module._load (module.js:280:25)
W20140608-11:58:32.132(-4)? (STDERR) at Module.require (module.js:364:17)
W20140608-11:58:32.132(-4)? (STDERR) at require (module.js:380:17)
有任何想法吗?
@ChristianFritz,从应用程序的根目录运行 npm install node-xmpp 会创建 \node_modules。当我运行服务器时,meteor 爆炸了,因为它认为它们是常规的应用程序文件。
=> Errors prevented startup:
While building the application:
node_modules/node-xmpp/node_modules/browserify/node_modules/insert-module-globals/node_modules/browserify/node_modules/insert-module-globals/node_modules/lexical-scope/node_modules/astw/node_modules/esprima-six/demo/collector.html:1: Can't set DOCTYPE here. (Meteor sets <!DOCTYPE html> for you)