{"record":{"id":"04d71472eb7fa52d","repo":"balderdashy/sails","slug":"on-sails-required-version-and-the-locally-insta","errorCode":null,"errorMessage":"on Sails `REQUIRED_VERSION`, and the locally installed Sails is `LOCAL_VERSION`!","messagePattern":"on Sails `REQUIRED_VERSION`, and the locally installed Sails is `LOCAL_VERSION`!","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"errors/warn.js","lineNumber":25,"sourceCode":"\n// Once per process:\n// 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() {","sourceCodeStart":7,"sourceCodeEnd":43,"githubUrl":"https://github.com/balderdashy/sails/blob/7b76422cc27823df033572bdda5c4910a68b697f/errors/warn.js#L7-L43","documentation":"Third line of the `incompatibleLocalSails` banner (errors/warn.js:25), showing the concrete versions: the required semver range from package.json (REQUIRED_VERSION) and the actually installed local Sails version (LOCAL_VERSION). It makes the mismatch explicit so the developer can decide whether to change package.json or the installed package.","triggerScenarios":"Emitted during `sails lift` when warn.incompatibleLocalSails(requiredVersion, localVersion) is invoked because the local sails version does not satisfy the package.json range.","commonSituations":"Upgrading to a new Sails major without reinstalling; using an app scaffolded with an older Sails under a newer global CLI; CI cache restoring an old node_modules.","solutions":["Run `npm install sails@<requiredVersion>` using the required version shown in this warning.","Or change package.json's sails range to match the installed version if that version is intended.","Run `npm outdated sails` to see the drift and update deliberately."],"exampleFix":"// terminal, before\nsails lift   // prints: required ^0.12.0, installed 1.5.3\n// after\nnpm install sails@0.12.0","handlingStrategy":"validation","validationCode":"const fs = require('fs');\nconst pkg = JSON.parse(fs.readFileSync('./package.json', 'utf8'));\nconst local = JSON.parse(fs.readFileSync('./node_modules/sails/package.json', 'utf8'));\nconsole.log('required:', pkg.dependencies.sails, '| installed:', local.version);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["After any sails version change, run the suggested `npm install sails@<requiredVersion>` immediately.","Keep a single install tool (npm OR yarn) per project to avoid divergent resolution.","Document the required sails version in the project README."],"tags":["sails","semver","version-mismatch","npm"],"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"}