homerchen19 / nba-go

🏀 💻 The finest NBA CLI.
https://www.npmjs.com/package/nba-go
MIT License
3.71k stars 221 forks source link

Can't install on node.js v8.9.1 #49

Closed ghost closed 6 years ago

ghost commented 7 years ago

I recently installed node.js version 8.9.1 since then nba-go doesn't work. I tried installing commander.js but nothing happened, and also tried with 'sudo' I'm on macOS High Sierra. Thanks.

module.js:538
    throw err;
    ^

Error: Cannot find module 'commander'
    at Function.Module._resolveFilename (module.js:536:15)
    at Function.Module._load (module.js:466:25)
    at Module.require (module.js:579:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/nba-go/lib/cli.js:4:18)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
homerchen19 commented 7 years ago

That's weird 😕 Could you install it again, and clear npm cache?

ghost commented 7 years ago

Well... $ npm cache clear -f


npm ERR! As of npm@5, the npm cache self-heals from corruption issues and data extracted from the cache is guaranteed to be valid. If you want to make sure everything is consistent, use 'npm cache verify' instead.
npm ERR!
npm ERR! If you're sure you want to delete the entire cache, rerun this command with --force.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/djamal/.npm/_logs/2017-11-16T12_38_37_594Z-debug.log
jzferreira commented 7 years ago

Hi @fenek5

I just installed normally here and I'm using a mac OS high Sierra too. I'm using nvm to install node v8.9.1 (Now using node v8.9.1 (npm v5.5.1)) and after that npm install -g nba-go.

I couldn't see the real reason for the problem just based on the log that you shared. Sorry for that.

ghost commented 7 years ago

Well, here's the thing, I installed nvm after nba-go maybe that's why ?

Screen : http://www.giphy.com/gifs/xUOxfabddd1wEwYMne

jzferreira commented 7 years ago

No...use this command: which node and sees path of node binary.

If you are using nvm then something like this will appear: /\<your user path>/.nvm/versions/node/v8.9.1/bin/node

With NPM you can do the samething which npm /\<user path>/.nvm/versions/node/v8.9.1/bin/npm

So, you can follow these steps:

  1. nvm install v8.9.1
  2. npm install -g nba-go

You don't need to be root to do that.

note: your gif was great but the error part was too fast

jzferreira commented 6 years ago

@fenek5

So, everything's ok now?

ghost commented 6 years ago

So as I said, it doesn't work for me on node.js version 8.9.1, but it does very well on version 6.12.0, I use nvm nvm use 6 or nvm use 8 to switch very quickly between the two version, but of course it works better on version 6 😀

homerchen19 commented 6 years ago

It seems to be solved.