【问题标题】:Error while installing natural node in meteor project在流星项目中安装自然节点时出错
【发布时间】:2014-06-03 11:39:15
【问题描述】:
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

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

【问题讨论】:

标签: meteor nlp


【解决方案1】:

您有一个名为 Natural 的包(不确定是哪个包),它没有按照正确的包规范构建或已被修改。

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

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

删除~/.meteorite/packages中的文件和文件夹

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

从看起来你以某种方式将https://github.com/NaturalNode/natural 克隆到陨石中的样子。您必须 look at how to build a package 才能获得流星。

您使用的文件是一个 npm 模块,如果您将文件复制到其中,则不仅仅适用于流星。您必须制作兼容的陨石包才能使其工作。或者使用meteor-npm直接在你的应用中使用npm模块。

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

【讨论】:

  • 当我运行“mrt add npm”时,出现以下错误:/usr/local/lib/node_modules/meteorite/lib/meteor.js:154 throw "Error running a command:" +错误; ^ 运行命令时出错:错误:命令失败:=> 扫描包时出错:构建包时 router:错误:没有这样的包:'page-js-ie-support' 错误:没有这样的包:'HTML5-History -API' ....如何防止这种情况发生??
  • Akshat!... 从 ~/.meteorite/packages 和 smart.json 中删除了自然包。现在运行应用程序时,显示以下错误:W20140603-13:34:10.496(1)? (STDERR)/home/priya/.meteor/tools/c2a0453c51/lib/node_modules/fibers/future.js:173 W20140603-13:34:10.497(1)? (STDERR)抛出(前); W20140603-13:34:10.497(1)? (STDERR) ^ W20140603-13:34:10.498(1)? (STDERR) ReferenceError: 要求未定义 W20140603-13:34:10.498(1)? (STDERR) at app/node_modules/natural/node_modules/apparatus/lib/apparatus/classifier/bayes_classifier.js:23:12......现在该怎么办?
  • 它列出的 package.js 在这个目录中:....~/gbproject/packages/npm/package.js。因为早些时候,我收到关于在项目中不搜索此文件的错误。可以看到 npm.require('path')。我应该在这个文件中添加“npm.require('natural')”还是在我想使用这个包的地方添加??
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-12-03
  • 1970-01-01
  • 1970-01-01
  • 2014-07-20
  • 2016-10-12
  • 1970-01-01
相关资源
最近更新 更多