CleverStack / cleverstack-cli

CLI for CleverStack
http://youtube.com/watch?v=-4ArURHExhQ
MIT License
196 stars 33 forks source link

grunt fails while installing modules #56

Closed marco-gallinari closed 9 years ago

marco-gallinari commented 9 years ago

After init app, grunt tasks fail installing standard backend modules.

⇒  clever install clever-odm
Attempting to install clever-odm...
  ├── Searching for modules...
  ├──   Searching NPM...
  ├──   Searching Bower...
  ├── ⚠ Installing clever-odm...
  ├── Installing NPM modules for clever-odm...
✔    Successfully installed clever-odm...
  ├── Installing bundledDependencies...
  ├── ⚠ Running grunt tasks for module clever-odm...
Loading "Gruntfile.js" tasks...ERROR
>> Error: Cannot find module 'utils'
Warning: Task "readme" not found. Use --force to continue.

Aborted due to warnings.
✔  Successfully installed.
⇒  clever install clever-auth 
Attempting to install clever-auth...
  ├── Searching for modules...
  ├──   Searching NPM...
  ├──   Searching Bower...
  ├── ⚠ Installing clever-auth...
  ├── Installing NPM modules for clever-auth...
✔    Successfully installed clever-auth...
  ├── Installing bundledDependencies...
  ├── ⚠ Running grunt tasks for module clever-auth...
Loading "Gruntfile.js" tasks...ERROR
>> Error: Cannot find module 'utils'
Warning: Task "prompt:cleverAuthConfig" not found. Use --force to continue.

Aborted due to warnings.
✔  Successfully installed.
⇒  clever install clever-users
Attempting to install clever-users...
  ├── Searching for modules...
  ├──   Searching NPM...
  ├──   Searching Bower...
  ├── ⚠ Installing clever-users...
  ├── Installing NPM modules for clever-users...
✔    Successfully installed clever-users...
  ├── Installing bundledDependencies...
Possibly unhandled TypeError: Object Error: Cannot find module 'config' has no method 'match'
    at /usr/local/lib/node_modules/cleverstack-cli/lib/util/grunt.js:73:26
From previous event:
    at new Promise (/usr/local/lib/node_modules/cleverstack-cli/node_modules/bluebird/js/main/promise.js:84:37)
    at exports.findGruntFile (/usr/local/lib/node_modules/cleverstack-cli/lib/util/grunt.js:91:12)
    at /usr/local/lib/node_modules/cleverstack-cli/lib/util/grunt.js:67:9
From previous event:
    at new Promise (/usr/local/lib/node_modules/cleverstack-cli/node_modules/bluebird/js/main/promise.js:84:37)
    at exports.readTasks (/usr/local/lib/node_modules/cleverstack-cli/lib/util/grunt.js:62:12)
    at /usr/local/lib/node_modules/cleverstack-cli/lib/util/grunt.js:182:9
From previous event:
    at new Promise (/usr/local/lib/node_modules/cleverstack-cli/node_modules/bluebird/js/main/promise.js:84:37)
    at Object.exports.runTasks (/usr/local/lib/node_modules/cleverstack-cli/lib/util/grunt.js:181:12)
    at /usr/local/lib/node_modules/cleverstack-cli/lib/install.js:131:46
    at iterate (/usr/local/lib/node_modules/cleverstack-cli/node_modules/async/lib/async.js:149:13)
    at Object.async.eachSeries (/usr/local/lib/node_modules/cleverstack-cli/node_modules/async/lib/async.js:165:9)
    at /usr/local/lib/node_modules/cleverstack-cli/lib/install.js:127:39
From previous event:
    at new Promise (/usr/local/lib/node_modules/cleverstack-cli/node_modules/bluebird/js/main/promise.js:84:37)
    at Object.exports.addToMainBundleDeps (/usr/local/lib/node_modules/cleverstack-cli/lib/util/dependencies.js:92:12)
    at /usr/local/lib/node_modules/cleverstack-cli/lib/install.js:124:30
    at done (/usr/local/lib/node_modules/cleverstack-cli/node_modules/async/lib/async.js:135:19)
    at /usr/local/lib/node_modules/cleverstack-cli/node_modules/async/lib/async.js:32:16
    at /usr/local/lib/node_modules/cleverstack-cli/lib/install.js:115:33
From previous event:
    at new Promise (/usr/local/lib/node_modules/cleverstack-cli/node_modules/bluebird/js/main/promise.js:84:37)
    at Object.exports.installBundleDeps (/usr/local/lib/node_modules/cleverstack-cli/lib/util/dependencies.js:17:12)
    at /usr/local/lib/node_modules/cleverstack-cli/lib/install.js:113:30
    at /usr/local/lib/node_modules/cleverstack-cli/node_modules/async/lib/async.js:125:13
    at Array.forEach (native)
    at _each (/usr/local/lib/node_modules/cleverstack-cli/node_modules/async/lib/async.js:46:24)
    at Object.async.each (/usr/local/lib/node_modules/cleverstack-cli/node_modules/async/lib/async.js:124:9)
    at EventEmitter.<anonymous> (/usr/local/lib/node_modules/cleverstack-cli/lib/install.js:109:23)
pilsy commented 9 years ago

@marco-gallinari this looks like it's caused by the NODE_PATH, what is your NODE_PATH set to (if at all) ?

echo $NODE_PATH

marco-gallinari commented 9 years ago

@pilsy you're right, my env variables were missing NODE_PATH variable. I've added it to /etc/environment but unfortunately the error is still there...

⇒  echo $NODE_PATH          
/usr/local/lib/node_modules

⇒  clever install clever-odm
Attempting to install clever-odm...
  ├── Searching for modules...
  ├──   Searching NPM...
  ├──   Searching Bower...
  ├── ⚠ Installing clever-odm...
  ├── Installing NPM modules for clever-odm...
✔    Successfully installed clever-odm...
  ├── Installing bundledDependencies...
  ├── ⚠ Running grunt tasks for module clever-odm...
Loading "Gruntfile.js" tasks...ERROR
>> Error: Cannot find module 'utils'
Warning: Task "readme" not found. Use --force to continue.

Aborted due to warnings.
✔  Successfully installed.
pilsy commented 9 years ago

So by the looks of it you have not correctly set your NODE_PATH, take a look at http://cleverstack.io/documentation/backend/#backend-magic-modules for details.

export NODE_PATH=./lib/:./modules/:$NODE_PATH will work for you

Overall this is still an issue, you should not have to set your NODE_PATH for clever commands, i'm taking a look at it now...

marco-gallinari commented 9 years ago

Thank you, this fixed my problems.

My two cents, this issue appeared in the last 15 days, since I was able to use the cli without errors on 28th feb.

pilsy commented 9 years ago

Thanks @marco-gallinari, i just fixed the issue :+1: