Error while installing natural node in meteor project - meteor

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
Please guide me in this direction. This error is becoming a recursive kind of error. Have broke my head in this problem but still stuck. Thanks in advance

You have a package called Natural (not sure which) which isn't built to the correct packages specifications or has been modified somehow.
This can't be fixed that easily, you would have to contact the author of the package to fix it or modify it yourself. I can't find NaturalNode on atmosphere so its likely a custom package.
You might want to make the rest of your app work to debug fixing it though. To do that you need to remove this package
Remove the files and folders in ~/.meteorite/packages
Look through your packages smart.json and remove the offending package (natural). and run mrt update. And remove the rest of the code in your app relating to natural that might stop your app booting up.
From what it looks like you've cloned https://github.com/NaturalNode/natural into meteorite somehow. You would have to look at how to build a package for meteor.
The files you have used are an npm module and don't just work with meteor if you copy the files in. You have to make a compatible meteorite package for it to work. Or use meteor-npm to use the npm module in your app directly.
This project may also help you get started as an example of how to make a wrapper for an npm module to use with meteor

Related

Meteor adding okgrow:accounts-ui-react atmosphere package not working

I am running a Meteor 1.4.2.3 application and everything has been running fine so far. I have been following the Level Up Tutorials and I've come to a point where I want to add user accounts.
In order to do that I'm using the `okgrow:accounts-ui-react' atmosphere package which can be found here.
I've followed all the steps by running the following 3 lines in the console:
> meteor add okgrow:accounts-ui-react
> npm install --save react-komposer classnames
> meteor add accounts-password
Those commands all ran successfully.
Now when I want to start my Meteor application by running meteor in the console I get the following error:
Does anyone know what I could be doing wrong?
Things I have tried that haven't solved it:
Updating all my meteor packages using the meteor update --all-packages command
Deleting the node_modules folder and running 'meteor' again.
The issue here is that React Komposer completely changed their api in the latest version for some reason. There is an outstanding issue regarding this here:
https://github.com/okgrow/accounts-ui-react/issues/4
In the meantime, I'd suggest https://github.com/studiointeract/accounts-ui as development has continued on it again.

Hot swap of local Meteor package

I am using local Meteor package for my app (not posted on Atmosphere.js).
When I update this package elsewhere, I proceed with the following:
Update version of the package.
Delete old package from /packages/ directory of the live app.
See my program search for packages 3(?) times and then crash:
Your app is crashing. Here's the latest log:
Errors prevented startup:
While selecting package versions:
error: unknown package in top-level dependencies: vladimir3000:testpack
Your application has errors. Waiting for file change.
Copy new package with new version.
See my app picking up the changes and going live again:
vladimir3000:testpack upgraded from 0.0.2 to 0.0.3
=>Meteor server restarted
Is there a way to avoid step 3 and more elegantly instruct meteor to replace one package with another. Meteor update would not work as the package is not on atmosphere.js. Or hot swap is something from SOA world not from blood and fibers of Meteor javascript?
You can simply paste over the files for the package.
When you delete the old package, Meteor sees a file change and rebuilds the app. Since the package no longer exists in the packages directory, Meteor will try to pull it down from Atmosphere since it sees that there is a dependency on vladimir3000:testpack in .meteor/packages.
It will attempt to resolve this dependency a few times, with each build failing because the package you are referencing is unknown.
You can stop meteor and delete and replace the folder. Or you can copy and paste over the folder. The second method is preferable because Meteor will simply rebuild with all of the new files, rather than rebuilding and trying to resolve the dependency using Atmosphere.

check is not defined in meteor.js

I am new to meteor, I was trying to use file upload using
tomitrescak/meteor-uploads
I successfully uploaded some file, but when I tried to delete the uploaded file, I got error in my terminal Reference Error:check is not defined
I have checked the documentation and searched the web regarding this error but could not find any solution for this.
Note: I got similar error while studing http://meteortips.com/second-meteor-tutorial/iron-router-part-1/
OS: Ubuntu 14.04
meteor: 1.2.1
TL;DR
$ meteor add check
Longer version
In Meteor version prior to v1.2, a core package called meteor-platform used to export some symbols, including check.
Since v1.2, this is no longer the case and those symbols are no longer available via the platform, but using dedicated packages instead.
It is likely that one of the packages that you are using (or your app code itself) is using check (probably in one of its methods) without declaring it as a dependency.
Until the package maintainers update the dependency, you should be able to overcome the error by adding check as a top-level dependency:
$ meteor add check
If you identify which package is causing the issue, you can report it on GitHub, or fork the package yourself, add the missing dependencies and submit a pull-request.

Meteor 0.9.3.1: node modules not being installed from packages.json

I've installed a fresh copy of Meteor and my application. I am now running version Meteor 0.9.3.1.
I expected the nodejs modules to install when I started my app but nothing appeared to happen. As a result when trying to invoke methods that use these node modules:
TypeError: Object #<Object> has no method 'npmRequire'
For example the graphics lib is being invoked like so:
var gm = Meteor.npmRequire('gm');
I also have the meteorhacks:npm module installed.
I can't see anything I'm doing wrong. Here's my packages.json file:
{
"gm" :"1.16.0",
"mkdirp" :"0.5.0"
}
Anyone got any idea on this?
Thank you
I'm not sure what the problem was, but I did a fresh install and installed meteorhacks:npm first then ran my app. The node modules installed at that point. All working now :)

Error when adding package accounts-ui-bootstrap-dropdown

I'm trying to add a package to a meteor project using meteorite using the command:
mrt add accounts-ui-bootstrap-dropdown
And the command shows me this error:
tag: https://github.com/erobit/meteor-accounts-ui-bootstrap-dropdown.git#v0.1.5
fs.js:730
return binding.symlink(preprocessSymlinkDestination(destination, type),
^
Error: ENOTDIR, not a directory '/Users/arturcarvalho/projects/effinlist/.meteor/packages/accounts-ui-bootstrap-dropdown'
at Object.fs.symlinkSync (fs.js:730:18)
at /usr/local/lib/node_modules/meteorite/lib/dependencies/package.js:129:10
at /usr/local/lib/node_modules/meteorite/lib/sources/git.js:75:15
at GitSource._load (/usr/local/lib/node_modules/meteorite/lib/sources/git.js:120:12)
at /usr/local/lib/node_modules/meteorite/lib/sources/git.js:73:18
at /usr/local/lib/node_modules/meteorite/lib/sources/git.js:89:5
at /usr/local/lib/node_modules/meteorite/lib/sources/git.js:216:5
at ChildProcess.exithandler (child_process.js:635:7)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:735:16)
If I run mrt list after this, it shows me the following error:
While building package `accounts-ui-bootstrap-dropdown`:
error: no such package: 'accounts-urls'
I can't uninstall the package and tried to reinstall meteorite but no luck. Could somebody help me with this? I'm using Max OS X.
Thanks!
are you on Meteor 0.6.5?
if so it's because the package hasn't been updated yet to work with that version, there was a lot of api changes in the way you format your package.js file and most packages on meteorite haven't been updated to adhere to the new style yet so they all break.
Recommendation:
1 Use this command to downgrade and wait a few weeks until atmosphere packages get corrected
"The way to downgrade is:
$ meteor update --release 0.6.4.1
... but that won't actually undo the other change that updating your
app to 0.6.5 did. So you'll also want to edit your ".meteor/packages"
file and remove the line "standard-app-packages". "
2 Send a PR to the package creator with an updated package.js file adhering to the api rules listed here
https://github.com/meteor/meteor/blob/devel/History.md
File that needs to be updated:
https://github.com/erobit/meteor-accounts-ui-bootstrap-dropdown/blob/master/package.js
The package has been updated on atmosphere to support the latest meteor release v0.6.5. If you are running latest meteor, you should be able to simply remove and re-add the package.
mrt remove accounts-ui-bootstrap-dropdown
mrt add accounts-ui-bootstrap-dropdown
Note: Refer to the readme on the github project page at the url below, as I have updated the installation instructions with more details.
https://github.com/erobit/meteor-accounts-ui-bootstrap-dropdown/blob/master/README.md
Can you try add 'accounts-urls' first?

Resources