heartsucker / node-deb

Debian packaging for Node.js projects
https://www.npmjs.com/package/node-deb
MIT License
205 stars 54 forks source link

bash: node-deb: command not found #96

Closed totem415 closed 6 years ago

totem415 commented 6 years ago

I followed your instructions and installed Node-deb on my Beaglebone Black running "Debian GNU/Linux 9 (stretch)" via this command from my Node project's root directory:

npm install node-deb --save

Everything appeared to install correctly:

npm WARN prefer global node-deb@0.10.7 should be installed with -g
test1up@0.0.1 /var/lib/cloud9/MercuryDesign/trunk
└── node-deb@0.10.7

This is the only project on this machine that will use node-deb, so I'm not sweating the global thing.

Once that was all finished, none of the other commands listed in your instructions work. Here's an example:

oot@1upTester:/var/lib/cloud9/MercuryDesign/trunk# node-deb --help
bash: node-deb: command not found
root@1upTester:/var/lib/cloud9/MercuryDesign/trunk# node-deb -v
bash: node-deb: command not found

Do I have to install globally for node-deb to work? Or is something else going on? My apologies if I'm doing something stupid.

Thanks for your help.

-roger

totem415 commented 6 years ago

OK, so just to be sure, I tried installing it globally, but it still doesn't work:

root@1upTester:/var/lib/cloud9/MercuryDesign/trunk# npm install node-deb -g --save
/usr/bin/node-deb -> /usr/lib/node_modules/node-deb/node-deb
/usr/lib
└── node-deb@0.10.7

root@1upTester:/var/lib/cloud9/MercuryDesign/trunk# node-deb -v
/usr/bin/node-deb: line 77: jq: command not found
root@1upTester:/var/lib/cloud9/MercuryDesign/trunk# node-deb --help
/usr/bin/node-deb: line 77: jq: command not found

No dice.

jcvernaleo commented 6 years ago

For that global example it looks like you just need jq (a json parser) installed. On Debian/Ubuntu you can install it with: sudo apt-get install jq

jcvernaleo commented 6 years ago

As for you first (non-local example), when you install locally (without -g) node-deb is there, just not in your path.

jcv@triforce tmp $ npm install node-deb --save
npm WARN saveError ENOENT: no such file or directory, open '/data/shared/tmp/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/data/shared/tmp/package.json'
npm WARN tmp No description
npm WARN tmp No repository field.
npm WARN tmp No README data
npm WARN tmp No license field.

+ node-deb@0.10.7
added 1 package from 1 contributor in 0.772s
jcv@triforce tmp $ which node-deb
jcv@triforce tmp $ 

but it is there:

jcv@triforce tmp $ ls node_modules/.bin/
node-deb

so you can just run it with the full path:

./node_modules/.bin/node-deb
totem415 commented 6 years ago

Cool.

Now I can get it responding to commands when installed globally or just locally.

Thanks very much for your help.

-roger

heartsucker commented 6 years ago

Since this was opened, i there anything I can do to tweak the package so that it's easier to run without the -g option? Like for projects that want to pin to a version so a dev could have multiple projects that on their machine that have dependencies on different versions of node-deb. Asking because honestly, I'm not a node person and this was built when I was doing ops to help out my team with deploys.