2

I'm working on a project that was originally made with sails 0.9.8.something and was recently updated to 0.10.4. I've received errors while trying to run sails lift since then. Here's the error:

module.js:340
    throw err;
          ^
Error: Cannot find module './Sails'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/Users/mjbrender/Documents/Development/session86/node_modules/sails/lib/app/index.js:6:13)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)

To confirm, I've updated locally:

$ sails -v
0.10.4

And after reading this, I deleted and updated as recommended. Still no luck. Any clue what's up?

Community
  • 1
  • 1
mbb
  • 3,052
  • 1
  • 27
  • 28

1 Answers1

2

You need to install sails locally in your project directory as well. Delete the node_modules/sails folder and run npm install sails in the root directory of your application. See if this solves the issue.

A rough migration guide can also be found here

Xinzz
  • 2,242
  • 1
  • 13
  • 26
  • Exactly - you hit it on the head. I ran installations globally but not locally. Thanks! – mbb Aug 14 '14 at 12:42
  • It's not quite the case that you *have* to have Sails installed locally in your project. You can remove the *node_modules/sails* folder entirely and still run `sails lift` if you have Sails installed globally (but not `node app.js`). What is true is that *if* you have Sails installed locally in your project, then that's the copy that will be used when you run `sails lift`--not the global one! – sgress454 Aug 15 '14 at 15:20
  • The link in your answer is broken – Igbanam Mar 23 '16 at 11:35