Search code examples
angularjsmeteornpmrequirementspeer

NPM peer requirements error


Apologies if this is a dumb question - I'm a complete Meteor Noob...

I'm building an app using meteor 1.3.1 and the Socially tutorial as a reference as it does something very similar to what I need, but I keep seeing the same error in my console and just can't figure it out.

I've installed the accounts.ui package:

meteor add dotansimha:accounts-ui-angular

then added that package as a dependency in my angular module:

angular.module('dkfitness', [
'angular-meteor',
'ui.router',
'angularMoment',
'accounts.ui'
]);

I have angular installed, .meteor/versions lists:

[email protected]_2

but I keep seeing the following error:

check-npm-versions.js:17 Error: Cannot find module 'angular/package.json'(…) check-npm-versions.js:48 WARNING: npm peer requirements not installed:- angular@^1.2.27 not installed.

I've tried to force the package version of angular to 1.2.27 I've also run:

meteor npm install --save angular

Neither fixes the issue. Can anyone tell me what I am doing wrong?


Solution

  • seems that the offending line of code has been removed from the dotansimha:dotansimha:accounts-ui-angular

    But there was no jump in the release number. Its still 0.0.4

    Anyhow to fix this issue just remove and add the package. meteor remove dotansimha:accounts-ui-angular meteor add dotansimha:accounts-ui-angular

    @alexbouchardd: Thanks for spotting this issue.

    Update: The problem is also due to this portion in accounts-ui-angular.js

    • try {
    • if (Package['modules-runtime']) {
    • var require = Package['modules-runtime'].meteorInstall();
    • require('angular');
    • }
    • } catch(e) {
    • throw new Error('angular package is missing');
    • }

    Reverted the codes here to the earlier version

    • if (!window.angular) {
    • require("angular");
    • }

    Followed alexbouchardd's steps to clone and replace dotansimha:dotansimha:accounts-ui-angular