Suppress unresolvable modules warning?

I’m getting this warning every time I update my code (the server restarts):

Unable to resolve some modules:

  "pg" in

If you notice problems related to these missing modules, consider running:

  meteor npm install --save pg

The code in question referencing pg:

  pg: function (Raven) {
    // Using fill helper here is hard because of `this` binding
    var pg = require('pg');
    var origQuery = pg.Connection.prototype.query;
    pg.Connection.prototype.query = function (text) {
        category: 'postgres',
        message: text
      });, text);
    originals.push([pg.Connection.prototype, 'query', origQuery]);

The thing is, I’ll never call this pg method, and so the require will never be called in this case. But it’s still going to bug me on every reload. :confounded: I don’t want to have to bloat my node_modules just to satisfy this loose requirement. Can I suppress this somehow?

Aha! Found the solution in another thread. This solved it:

import { Meteor } from 'meteor/meteor';
import { version } from '/package.json';
let Raven;

export function ravenInit() {
  if (!Meteor.isServer) return;

  const r = require;
  Raven = r('raven');

  Raven.config(Meteor.settings.sentryDsn, {
    environment: process.env.NODE_ENV,
    release: version,

export default Raven;

Apparently if you abbreviate require to r, it suppresses the warnings.