在流星应用程序中安装自然包 [英] Installing natural package in a meteor application

查看:79
本文介绍了在流星应用程序中安装自然包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

具有自然语言处理功能.使用"npm install natural"在我的应用程序中添加了自然节点程序包.但是在使用"sudo meteor"运行应用程序时进行安装后,出现了有关"ReferenceError:未定义"的错误"的一些错误.谷歌搜索后发现,需要执行以下步骤:

For having natural language processing facility. Have added natural node package in my application using "npm install natural". But after installation while running the application using "sudo meteor", got some error about ""ReferenceError: require is not defined"". After googling found that need to do following steps:

1)删除应用程序根目录顶部的node_modules(完成此部分)

1) Remove node_modules on the top of the root of the application (Done this part)

2)在packages.json文件中还添加了自然":"0.1.27"

2) Added "natural": "0.1.27" in packages.json file also

3)使用"mrt add npm"安装npm.但是在使用"sudo meteor"的同时将其安装在应用程序中后出现以下错误.

3) Install npm using ""mrt add npm"". But getting following error after installing it in the application, while using ""sudo meteor"".

        => Meteor 0.8.1.3 is available. Update this project with 'meteor update'.

初始化mongo数据库...这可能需要一点时间. npm ERR!缺少:rimraf@2.x,由meteor-npm@0.1.10要求 npm ERR!缺少:mkdirp@0.3.x,由meteor-npm@0.1.10要求 npm ERR!错误代码0

Initializing mongo database... this may take a moment. npm ERR! missing: rimraf@2.x, required by meteor-npm@0.1.10 npm ERR! missing: mkdirp@0.3.x, required by meteor-npm@0.1.10 npm ERR! not ok code 0

=>错误导致无法启动:

=> Errors prevented startup:

在构建软件包router时: 错误:没有这样的包:'ui'

While building package router: error: no such package: 'ui'

在构建软件包npm时: 错误:无法读取npm版本锁定信息

While building package npm: error: couldn't read npm version lock information

=>您的应用程序有错误.等待文件更改.

=> Your application has errors. Waiting for file change.

任何指针应该做什么.什么也没得到,这个错误占用了我的全部时间.预先感谢

Any pointers what should be done. Not getting anything, this error taking my whole time. Thanks in advance

推荐答案

要在流星应用程序中使用NPM软件包,您需要先安装meteor-npm mrt add npm

To use NPM packages within your meteor application you need to first install meteor-npm mrt add npm

然后您必须像这样在项目的根目录中添加一个packages.json文件;

You then have to add a packages.json file at the root of your project like so;

{
  "natural": "0.1.27"
}

此文件更改时,流星将自动更新其依赖项.

When this file changes, meteor will automatically update its dependencies.

然后您可以使用var natural = Meteor.require("natural")

这篇关于在流星应用程序中安装自然包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆