在流星项目中安装自然节点时出错

时间:2014-06-03 11:39:15

标签: meteor nlp

I am working on a meteor project. Have to use natural package for natural language facility. I installed that using 'npm install natural'. But when ran the project, got error as 'ReferenceError: require is not defined'.

Added this line: var abc=Meteor.require('natural'); in the file in which have to use it. But when I am running the project, it is showing error as:=> Started proxy.
=> Meteor 0.8.1.3 is available. Update this project with 'meteor update'.
=> Started MongoDB.     
=> Errors prevented startup:

    While building package `router`:
    error: no such package: 'page-js-ie-support'
    error: no such package: 'HTML5-History-API'

-- When tried to install the above listed missing packages, showing error as: 

smart.json changed.. installing from smart.json, I got the following error after successfully installing various packages like natural, iron-router, paginated-subscription, router, accounts-ui-bootstrap-dropdown, spin. But after that showing following error. Why so?

/usr/local/lib/node_modules/meteorite/lib/dependencies/package.js:106
      throw('Could not locate package.js within path ' + self.source.packagePa
                                                       ^
Could not locate package.js within path /home/priya/.meteorite/packages/natural/NaturalNode/natural/d541ca394659521498ed36a7f6e03fef93163e53


-- The packages in my project are: I don't understand here as router package is already listed then why showing error while running the project.??

 meteor list --using
standard-app-packages
bootstrap
router
accounts-ui-bootstrap-dropdown
accounts-password
spin
paginated-subscription
email
insecure
iron-router
npm

请指导我这个方向。此错误正在成为一种递归错误。在这个问题上打破了我的头,但仍然卡住了。提前致谢

1 个答案:

答案 0 :(得分:0)

您有一个名为Natural的包(不确定是哪个),它不是根据正确的包规范构建的,或者是以某种方式进行了修改。

这不能轻易解决,您必须联系包的作者来修复它或自己修改它。我在大气中找不到NaturalNode所以它可能是一个自定义包。

您可能希望让应用程序的其余部分工作以调试修复它。为此,您需要删除此包

删除~/.meteorite/packages

中的文件和文件夹

查看你的软件包smart.json并删除有问题的软件包(自然)。并运行mrt update。并删除应用中与自然相关的其他代码,这些代码可能会阻止您的应用启动。

从你看来你以某种方式将https://github.com/NaturalNode/natural克隆到陨石中。对于流星,你必须look at how to build a package

您使用的文件是npm模块,如果您复制文件,则不要只使用meteor。您必须制作兼容的陨石包才能使用。或者使用meteor-npm直接在您的应用中使用npm模块。

This project也可以帮助您开始作为如何为npm模块使用包装器与流星一起使用的示例