balderdashy/sails · warning

`--dev` option is deprecated: Please do not use it.

Error message

`--dev` option is deprecated: Please do not use it.

What it means

Sails warns that the --dev CLI flag is deprecated. When loading configuration, if --dev is present in overrides, Sails prints this console.warn (before a logger exists) and sets the environment to 'development'. The app still lifts; the flag just should not be used anymore.

Source

Thrown at lib/app/configuration/load.js:120

              return undefined;
            })(),
            sockets: (function(){
              if (overrides.redis) {
                return { adapter: '@sailshq/socket.io-redis' };
              }
              return undefined;
            })(),

            // `--prod` command-line shortcut
            // `--staging` command-line shortcut
            // `--dev` command-line shortcut
            environment: (function(){
              if (overrides.staging) {// --staging
                return 'staging';
              } else if (overrides.prod){// --prod  (but it's cleaner to use NODE_ENV=production with no other environment instead)
                return 'production';
              } else if (overrides.dev) {// --dev  (deprecated)
                console.warn('`--dev` option is deprecated: Please do not use it.');
                // Note: we use `console.warn` here because we're not guaranteed
                // to have a working logger yet.
                return 'development';
              } else {
                return undefined;
              }
            })()//†

          });

        } catch (e) { return cb(e); }

        // Pass on overrides object
        return cb(undefined, overrides);
      },


View on GitHub (pinned to 7b76422cc2)

Solutions

  1. Remove --dev from your lift command; development is the default environment.
  2. Set NODE_ENV=development explicitly if you need to force it.
  3. Update npm scripts/CI configs to drop --dev.
  4. Use --prod (or NODE_ENV=production) only for production lifts.

Example fix

// before
"scripts": { "start": "sails lift --dev" }
// after
"scripts": { "start": "sails lift" }
Defensive patterns

Strategy: validation

Validate before calling

if (process.argv.includes('--dev')) { console.warn('Remove deprecated --dev flag; use NODE_ENV instead.'); }

Prevention

When it happens

Trigger: Lifting with `sails lift --dev`. The supported way to select the development environment is NODE_ENV=development (or no flag, since development is default).

Common situations: Old lift scripts or documentation carried over from legacy projects; muscle memory from older Sails versions; CI/deploy scripts invoking sails lift --dev.

Related errors


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