mgenev / how-to-sane

A demonstration of how to use the SANE stack
http://howtosane.ninja
MIT License
163 stars 22 forks source link

sane up failed by Error: Cannot find module 'which' #19

Closed feitian124 closed 9 years ago

feitian124 commented 9 years ago

i pulled the latest commit c1fd0e129da87ac7a9d0ada78714904ff2909222, then npm install, bower install, then find that sane up failed.

22:11 $ sane up
module.js:338
    throw err;
          ^
Error: Cannot find module 'which'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:278:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/home/ming/work/sane/lib/tasks/checkEnvironment.js:3:13)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (/home/ming/work/sane/node_modules/traceur/src/node/require.js:65:21)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)

after sudo npm install -g which it is resolved.

write here so anyone who met same problem may get help and we may need an solution or document.

IanVS commented 9 years ago

Hi @feitian124, what version of SANE are you using?

feitian124 commented 9 years ago

the latest one 0.0.24

IanVS commented 9 years ago

That looks like the bug that was fixed by https://github.com/artificialio/sane/commit/db69462f66cccfc24980929a4d13ae3ef2634b8a

But that bug was introduced and fixed after 0.0.24, so I can only think you must have a fork that is npm linked to your global. Try this:

$ rm -rf node_modules
$ npm uninstall -g sane-cli
$ npm cache clean
$ npm install -g sane-cli
$ npm install

After that, try to sane up again.

feitian124 commented 9 years ago

@IanVS thank you. I tried then sane up is ok without a global installed which.