Getting Cannot find module 'meteor/alanning:roles' Error


#1

Hi All:

New to Meteor here. Having trouble figuring out why I get this error. I’m basically running through the Angular 2 Socially tutorial and trying to add roles to the project.

I added the roles package with the following command:

meteor add alanning:roles

Then in the fixtures I added a users.js file where I check to see if there are any existing Meteor.users. If not, create an admin user and add it to the ‘admin’ role. When I import Roles I get an error.

This is the import command:

import { Roles } from ‘meteor/alanning:roles’;

Am I missing something? Any help would be appreciated.

Thanks in advance.


#2

What error are you getting?


#3

Hi Rob, thanks for the response. The error I’m getting is:

Cannot find module ‘meteor/alanning:roles’.


#4

That looks ok to me. Can you post some more code where you’re referencing it?


#5

Hi Rob,

I found out it was a typings issue and that the alanning:roles package needed to be included.

Thanks for the help.


#6

I think next time we really need to ask “Are you using TypeScript?” first…


#7

Hi,

Please, can you detail what you are doing to resolve the issue?

Thanks.


#8

Hi, I’m getting the same error even though I have added the package to my project and is importing it correctly.

import { Roles } from ‘meteor/alanning-roles’;

meteor add alanning:roles