balderdashy/sails · warning

You may consider running:

Error message

You may consider running:

What it means

This is a warning emitted by Sails when the local Sails dependency in node_modules has a corrupted, missing, or un-parseable package.json. Sails logs two follow-up lines, and this one ('You may consider running:') introduces the suggested repair command in the next line. It exists to help developers recover a broken local install of Sails without guessing at the right version.

Source

Thrown at errors/warn.js:54

  noPackageJSON: function() {
    log.warn('Cannot read package.json in the current directory (' + process.cwd() + ')');
    log.warn('Are you sure this is a Sails app?');
    log.warn();
  },

  notSailsApp: function() {
    log.warn('The package.json in the current directory does not list Sails as a dependency...');
    log.warn('Are you sure `' + process.cwd() + '` is a Sails app?');
    log.warn();
  },

  badLocalDependency: function(pathToLocalSails, requiredVersion) {
    log.warn(
      'The local Sails dependency installed at `' + pathToLocalSails + '` ' +
      'has a corrupted, missing, or un-parsable package.json file.'
    );
    log.warn('You may consider running:');
    log.warn('rm -rf ' + pathToLocalSails + ' && npm install sails@' + requiredVersion);
    log.warn();
  }
};

View on GitHub (pinned to 7b76422cc2)

Solutions

  1. Delete the broken Sails directory and reinstall: rm -rf node_modules/sails && npm install sails@<requiredVersion>
  2. If corruption is widespread, remove node_modules entirely and run npm install (or npm ci) fresh.
  3. Verify package-lock.json / yarn.lock points at the intended Sails version and reinstall from a clean cache (npm cache clean --force).

Example fix

// before (broken local dep)
node_modules/sails/package.json  // corrupted / unparsable
// after
rm -rf node_modules/sails && npm install sails@1.5.3
Defensive patterns

Strategy: validation

Validate before calling

const pkg = require('fs').existsSync('./node_modules/sails/package.json') && JSON.parse(require('fs').readFileSync('./node_modules/sails/package.json','utf8'));
if (!pkg || !pkg.version) console.warn('Local sails install is corrupt; reinstall before lifting.');

Prevention

When it happens

Trigger: Sails calls badLocalDependency(pathToLocalSails, requiredVersion) during lift when the package.json of the locally installed Sails at pathToLocalSails cannot be read or parsed, or is missing.

Common situations: Interrupted npm installs, manually edited or deleted node_modules/sails/package.json, partial git commits that excluded node_modules files, corrupted caches, or symlinks to a broken Sails checkout.

Related errors


AI-assisted analysis of balderdashy/sails@7b76422cc2 (2026-09-01). Data as JSON: /api/errors/9f382d2c24489c9a. Report an issue: GitHub.