{"record":{"id":"ddd03556929e3c1c","repo":"balderdashy/sails","slug":"if-you-run-into-compatibility-issues-try-installi","errorCode":null,"errorMessage":"If you run into compatibility issues, try installing REQUIRED_VERSION locally:","messagePattern":"If you run into compatibility issues, try installing REQUIRED_VERSION locally:","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"errors/warn.js","lineNumber":27,"sourceCode":"// Build logger using best-available information\n// when this module is initially required.\nvar rconf = require('../lib/app/configuration/rc')();\nvar log = CaptainsLog(rconf.log);\n\n\n/**\n * Warnings\n */\nmodule.exports = {\n\n  incompatibleLocalSails: function(requiredVersion, localVersion) {\n    log.warn('Trying to lift app using a local copy of `sails`');\n    log.warn('(located in ' + nodepath.resolve(process.cwd(), 'node_modules/sails') + ')');\n    log.warn();\n    log.warn('But the package.json in the current directory indicates a dependency');\n    log.warn('on Sails `' + requiredVersion + '`, and the locally installed Sails is `' + localVersion + '`!');\n    log.warn();\n    log.warn('If you run into compatibility issues, try installing ' + requiredVersion + ' locally:');\n    log.warn('    $ npm install sails@' + requiredVersion);\n    log.warn();\n    log.blank();\n  },\n\n\n\n  // Verbose-only warnings:\n\n  noPackageJSON: function() {\n    log.warn('Cannot read package.json in the current directory (' + process.cwd() + ')');\n    log.warn('Are you sure this is a Sails app?');\n    log.warn();\n  },\n\n  notSailsApp: function() {\n    log.warn('The package.json in the current directory does not list Sails as a dependency...');\n    log.warn('Are you sure `' + process.cwd() + '` is a Sails app?');","sourceCodeStart":9,"sourceCodeEnd":45,"githubUrl":"https://github.com/balderdashy/sails/blob/7b76422cc27823df033572bdda5c4910a68b697f/errors/warn.js#L9-L45","documentation":"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.","triggerScenarios":"Printed as part of warn.incompatibleLocalSails during `sails lift` whenever local sails != required range from package.json.","commonSituations":"Fresh clone without npm install; version bumped in package.json by a teammate; monorepo hoisting an incompatible sails version.","solutions":["Copy the suggested command: `npm install sails@<requiredVersion>` and run it in the project root.","Commit the updated package-lock.json so teammates get the same version.","In monorepos, add sails to the workspace's dependencies explicitly instead of relying on hoisting."],"exampleFix":"// before\nsails lift\n// after\nnpm install sails@^1.5.0\nsails lift","handlingStrategy":"validation","validationCode":"// package.json script guard\n\"scripts\": {\n  \"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)}\\\"\",\n  \"lift\": \"sails lift\"\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run the exact `npm install sails@<version>` command the warning prints.","Never ignore sails lift warnings in CI — fail the build on them.","Use `npm ci` rather than `npm install` in automated environments."],"tags":["sails","npm-install","version-mismatch"],"backgroundTag":"sails-local-sails-version-mismatch","analyzedSha":"7b76422cc27823df033572bdda5c4910a68b697f","analyzedAt":"2026-09-01T04:01:57.104Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}