Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run npm command line without add node to path

I have a folder with last version of node and npm (on ubuntu) :

node
 node_modules
 node
 npm
 npm.cmd

And would like to run node/npm without add node/node in classpath

Because node/npm returns : node/npm: node: not found

Idea ?

like image 658
Maryo Avatar asked Jun 16 '26 11:06

Maryo


1 Answers

What you can do is to call the npm-cli.js using node. So in the node folder, you can run npm commands by running:

./node node_modules/npm/bin/npm-cli.js <command> <args>

where and are the npm command and arguments.

like image 74
Adam Jonsson Avatar answered Jun 18 '26 02:06

Adam Jonsson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!