SukkaW / nali-cli

:anchor: Parse geoinfo of IP Address without leaving your terminal
https://nali.skk.moe
GNU General Public License v3.0
445 stars 29 forks source link

command not found: nali #2

Closed shanehh closed 4 years ago

shanehh commented 4 years ago

I installed nali with npm -g. But I had no idea that every global package as follows can work well except the nali.

❯ npm list -g --depth 0
/home/me/.nvm/versions/node/v13.1.0/lib
├── forever@1.0.0
├── koa-generator@1.1.17
├── nali@1.1.4
├── nodemon@2.0.2
├── npm@6.12.1
└── puppeteer@2.1.1
❯ nali -h
zsh: command not found: nali
SukkaW commented 4 years ago

@huulien Please check if your global node_modules/.bin is presented in $PATH

Take yarn as an example, $HOME/.config/yarn/global/node_modules/.bin should be added to PATH.

shanehh commented 4 years ago

@huulien Please check if your global node_modules/.bin is presented in $PATH

Take yarn as an example, $HOME/.config/yarn/global/node_modules/.bin should be added to PATH.

It looks like not being installed correctly, I dont know..

❯ whereis nodemon
nodemon: /home/me/.nvm/versions/node/v13.1.0/bin/nodemon

❯ whereis forever 
forever: /home/me/.nvm/versions/node/v13.1.0/bin/forever

❯ whereis nali   
nali:

❯ ls /home/me/.nvm/versions/node/v13.1.0/bin/
forever  koa  koa2  node  nodemon  npm  npx
SukkaW commented 4 years ago

@huulien You might have your nvm configured incorrectly. Try the command to see if global node_modules is presented in the PATH:

echo $PATH | grep "node_modules/.bin"
shanehh commented 4 years ago

@SukkaW Sorry, I forget how I installed my nvm. Nothing had been displayed when I entered echo $PATH | grep "node_modules/.bin".

I tried some other CLI apps like svgo, and they could work as expected. But I noticed that the given info is diff from nali's during package installing.

Installing of svgo:

❯ npm install -g svgo
/home/me/.nvm/versions/node/v13.1.0/bin/svgo -> /home/me/.nvm/versions/node/v13.1.0/lib/node_modules/svgo/bin/svgo
+ svgo@1.3.2
added 52 packages from 82 contributors in 4.699s
❯ svgo -v
1.3.2

Installing of nali:

❯ npm install -g nali
+ nali@1.1.4
added 6 packages from 7 contributors in 0.609s
❯ nali -v
zsh: command not found: nali

There is no /bin dir?

❯ ls /home/me/.nvm/versions/node/v13.1.0/lib/node_modules/nali/
block.js  index.js  LICENSE.md  node_modules  notes.md  package.json  README.md  service.js  test
imlonghao commented 4 years ago

nali-cli not nali

I mean npm install -g nali-cli not npm install -g nali