balderdashy/sails · warning

Are you sure `${process.cwd()}` is a Sails app?

Error message

Are you sure `${process.cwd()}` is a Sails app?

What it means

Second line of the `notSailsApp` warning (errors/warn.js:45), echoing the resolved working directory so the developer can double-check whether that path is actually a Sails app. It interpolates process.cwd() into the question.

Source

Thrown at errors/warn.js:45

    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. Check the echoed path and cd to the real Sails app root before lifting.
  2. Run `npm install sails` in that directory to register the dependency.
  3. Fix IDE/terminal run configurations to point at the app root.

Example fix

// before
sails lift   # cwd: /home/me/playground
// after
cd /home/me/apps/my-app && sails lift
Defensive patterns

Strategy: validation

Validate before calling

const pkg = require('./package.json');
if (!pkg.dependencies || !pkg.dependencies.sails) {
  console.error(`CWD ${process.cwd()} has no sails dependency; cd to the Sails app root or run: npm install sails`);
  process.exit(1);
}

Prevention

When it happens

Trigger: Same as errorIndex 107: package.json exists in CWD but does not declare sails as a dependency when `sails lift` runs.

Common situations: Lifting a freshly `npm init`-ed folder expecting sails to be implicit; IDE run configurations launching from the wrong directory; forgetting `npm install sails` after scaffolding manually.

Related errors


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