balderdashy/sails · warning

The package.json in the current directory does not list Sail

Error message

The package.json in the current directory does not list Sails as a dependency...

What it means

Warning from `notSailsApp` in errors/warn.js:44. A package.json WAS found and read in the current directory, but it does not list `sails` as a dependency, so Sails cannot confirm this folder is a Sails application. This protects against lifting arbitrary Node projects that happen to be in CWD.

Source

Thrown at errors/warn.js:44

    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?');
    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. Add sails to dependencies and install: `npm install sails` (or `npm install sails@<version>`).
  2. cd into the actual Sails app directory that has sails in its package.json and lift there.
  3. If this is not a Sails project, don't use `sails lift`; run the project's normal start script.

Example fix

// package.json before
"dependencies": { "express": "^4.0.0" }
// after
"dependencies": { "express": "^4.0.0", "sails": "^1.5.0" }
Defensive patterns

Strategy: validation

Validate before calling

const pkg = require('./package.json');
if (!(pkg.dependencies && pkg.dependencies.sails) && !(pkg.devDependencies && pkg.devDependencies.sails)) {
  console.error('sails is not a dependency here; run npm install sails or cd to your Sails app.');
  process.exit(1);
}

Prevention

When it happens

Trigger: `sails lift` run in a directory whose package.json lacks a `sails` entry under dependencies (or devDependencies as checked by the CLI); common when invoking a globally installed sails binary outside any sails project.

Common situations: Running sails CLI in a generic Node project or library repo; sails was removed from package.json during a migration; monorepo root with no sails dependency while the app is in packages/web.

Related errors


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