balderdashy/sails · warning

If you run into compatibility issues, try installing REQUIRE

Error message

If you run into compatibility issues, try installing REQUIRED_VERSION locally:

What it means

Fourth line of the `incompatibleLocalSails` banner (errors/warn.js:27) — the advisory portion telling the developer how to resolve the version mismatch by installing the exact required Sails version locally. Purely informational; Sails continues lifting (or proceeds with a warning) after printing it.

Source

Thrown at errors/warn.js:27

// Build logger using best-available information
// when this module is initially required.
var rconf = require('../lib/app/configuration/rc')();
var log = CaptainsLog(rconf.log);


/**
 * Warnings
 */
module.exports = {

  incompatibleLocalSails: function(requiredVersion, localVersion) {
    log.warn('Trying to lift app using a local copy of `sails`');
    log.warn('(located in ' + nodepath.resolve(process.cwd(), 'node_modules/sails') + ')');
    log.warn();
    log.warn('But the package.json in the current directory indicates a dependency');
    log.warn('on Sails `' + requiredVersion + '`, and the locally installed Sails is `' + localVersion + '`!');
    log.warn();
    log.warn('If you run into compatibility issues, try installing ' + requiredVersion + ' locally:');
    log.warn('    $ npm install sails@' + requiredVersion);
    log.warn();
    log.blank();
  },



  // Verbose-only warnings:

  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?');

View on GitHub (pinned to 7b76422cc2)

Solutions

  1. Copy the suggested command: `npm install sails@<requiredVersion>` and run it in the project root.
  2. Commit the updated package-lock.json so teammates get the same version.
  3. In monorepos, add sails to the workspace's dependencies explicitly instead of relying on hoisting.

Example fix

// before
sails lift
// after
npm install sails@^1.5.0
sails lift
Defensive patterns

Strategy: validation

Validate before calling

// package.json script guard
"scripts": {
  "prelift": "node -e \"const s=require('sails/package.json').version,r=require('./package.json').dependencies.sails; if(!require('semver').satisfies(s,r)){console.error('Run npm install sails@'+r);process.exit(1)}\"",
  "lift": "sails lift"
}

Prevention

When it happens

Trigger: Printed as part of warn.incompatibleLocalSails during `sails lift` whenever local sails != required range from package.json.

Common situations: Fresh clone without npm install; version bumped in package.json by a teammate; monorepo hoisting an incompatible sails version.

Related errors


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