ReferenceError: Accounts is not defined


#1

I just finished developing a Meteor package. Now I want to test it by adding it to a new Meteor app:

my_cool_package_name/package.js

Package.on_use(function(api){
	api.use("accounts-password@1.1.1");
});

Add my_cool_package_name to a new project

meteor add my_cool_package_name

Changes to your project's package version selections:
                                              
	accounts-base          added, version 1.2.0
	accounts-password      added, version 1.1.1

List installed packages

meteor list

	meteor-platform      1.2.2  Include a standard set of Meteor packages in your app
	my_cool_package_name  1.0.0+ This is my_cool_package_name

Start meteor

meteor

ReferenceError: Accounts is not defined

#2

api.use only makes exported var available to the package. You can additionally use api.imply to add exported vars anything that uses your package (including an app).

Package.on_use(function(api){
    api.use("accounts-password@1.1.1");
    api.imply("accounts-password");
});