{"record":{"id":"3840a54c55e562e6","repo":"balderdashy/sails","slug":"the-package-json-in-the-current-directory-does-not","errorCode":null,"errorMessage":"The package.json in the current directory does not list Sails as a dependency...","messagePattern":"The package\\.json in the current directory does not list Sails as a dependency\\.\\.\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"errors/warn.js","lineNumber":44,"sourceCode":"    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?');\n    log.warn();\n  },\n\n  badLocalDependency: function(pathToLocalSails, requiredVersion) {\n    log.warn(\n      'The local Sails dependency installed at `' + pathToLocalSails + '` ' +\n      'has a corrupted, missing, or un-parsable package.json file.'\n    );\n    log.warn('You may consider running:');\n    log.warn('rm -rf ' + pathToLocalSails + ' && npm install sails@' + requiredVersion);\n    log.warn();\n  }\n};\n","sourceCodeStart":26,"sourceCodeEnd":59,"githubUrl":"https://github.com/balderdashy/sails/blob/7b76422cc27823df033572bdda5c4910a68b697f/errors/warn.js#L26-L59","documentation":"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.","triggerScenarios":"`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.","commonSituations":"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.","solutions":["Add sails to dependencies and install: `npm install sails` (or `npm install sails@<version>`).","cd into the actual Sails app directory that has sails in its package.json and lift there.","If this is not a Sails project, don't use `sails lift`; run the project's normal start script."],"exampleFix":"// package.json before\n\"dependencies\": { \"express\": \"^4.0.0\" }\n// after\n\"dependencies\": { \"express\": \"^4.0.0\", \"sails\": \"^1.5.0\" }","handlingStrategy":"validation","validationCode":"const pkg = require('./package.json');\nif (!(pkg.dependencies && pkg.dependencies.sails) && !(pkg.devDependencies && pkg.devDependencies.sails)) {\n  console.error('sails is not a dependency here; run npm install sails or cd to your Sails app.');\n  process.exit(1);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ensure every Sails app's package.json lists sails under dependencies.","In monorepos, run sails commands inside the workspace package that depends on sails.","Don't remove sails from dependencies during refactors without stopping lifts."],"tags":["sails","package-json","dependency","project-structure"],"backgroundTag":"not-a-sails-app","analyzedSha":"7b76422cc27823df033572bdda5c4910a68b697f","analyzedAt":"2026-09-01T04:01:57.104Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}