{"record":{"id":"e06b62041cf3d8f6","repo":"balderdashy/sails","slug":"are-you-sure-process-cwd-is-a-sails-app","errorCode":null,"errorMessage":"Are you sure `${process.cwd()}` is a Sails app?","messagePattern":"Are you sure `(.+?)` is a Sails app\\?","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"errors/warn.js","lineNumber":45,"sourceCode":"    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":27,"sourceCodeEnd":59,"githubUrl":"https://github.com/balderdashy/sails/blob/7b76422cc27823df033572bdda5c4910a68b697f/errors/warn.js#L27-L59","documentation":"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.","triggerScenarios":"Same as errorIndex 107: package.json exists in CWD but does not declare sails as a dependency when `sails lift` runs.","commonSituations":"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.","solutions":["Check the echoed path and cd to the real Sails app root before lifting.","Run `npm install sails` in that directory to register the dependency.","Fix IDE/terminal run configurations to point at the app root."],"exampleFix":"// before\nsails lift   # cwd: /home/me/playground\n// after\ncd /home/me/apps/my-app && sails lift","handlingStrategy":"validation","validationCode":"const pkg = require('./package.json');\nif (!pkg.dependencies || !pkg.dependencies.sails) {\n  console.error(`CWD ${process.cwd()} has no sails dependency; cd to the Sails app root or run: npm install sails`);\n  process.exit(1);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check the echoed CWD in the warning against where you expect the app to live.","Fix terminal/IDE working directories to the app root.","Run `npm install sails` in freshly scaffolded folders before lifting."],"tags":["sails","cwd","dependency"],"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"}