Reputation: 10043
I'm trying to run a local package on Meteor.
I've got a correct package.js, have a smart.json, and it's inside my /packages directory in my Meteor project. The smart.json at my project looks like this:
{
"packages": {
"router": {},
"userErrors": {
"path": "/home/user/Documents/project/packages/userErrors"
}
}
}
And I am using api.add_files and all correctly. The code runs fine when I take it out of the packages folder. Is there something I'm missing in order to make this package run? I'm running Meteor with the mrt
command.
Upvotes: 26
Views: 16007
Reputation: 2922
You have to follow these two steps:
meteor create <package-name>
(This will create the package inside of your packages
folder).meteor add <package-name>
(This will add the reference of your new package to your /.meteor/packages
folder).And then you can start working on your new meteor package.
Upvotes: 2
Reputation: 907
Just like Xiv suggested,
Copy the package into packages folder (create "packages" folder inside main directory of your application).
Do
meteor add <package name>
Upvotes: 1
Reputation: 212
Machine: OSX 10.10.4, Meteor 1.1.0.3, Bash 3.2.57(1)-release
1.Create local meteor packages dir and example package.
mkdir ~/.meteor_local_packages && cd $_ && meteor create --package user:package-name
2. Check version set to 0.0.1 at least
cat ~/.meteor_local_packages/package-name/package.js | grep version:
3.Point to meteor local packages
echo 'export PACKAGE_DIRS=~/.meteor_local_packages' >> ~/.bash_profile && source ~/.bash_profile
4.Go to your meteor project dir
meteor add user:package-name
5.Show list
meteor list | grep user:package-name
Upvotes: 2
Reputation: 1082
The accepted answer is not as good as this one: https://dweldon.silvrback.com/local-packages
Upvotes: 10
Reputation: 59989
Meteor from 0.9 does not have a "packages" directory by default, but will still use it for local packages. Create it if it doesn't exist.
cd <your-app>
mkdir packages
Your locally developed package needs to be inside this folder. Of course you can simply create a symbolic link. You can do this yourself with ln -s
or use the feature of mrt:
mrt link-package /path/to/<your-package>
Please note, if you provide a relative path, this must be relative to the packages directory, not relative to your current location. So you might want to cd
into the packages directory first to avoid confusion.
Finally add the package:
meteor add <your-package>
IMPORTANT: <your-package>
needs to be the name of the description inside your package.js
. The name of the folder/symlink is not relevant for this procedure.
Package.describe({
name: "<your-package>"
});
If your local package has the same name as a package registered online, your local version will be used.
Upvotes: 31
Reputation: 4376
try to put your files in the 'packages' directory of your app and execute : meteor add [package-name]
Upvotes: 39