3

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 ?

2
  • Your question is not very clear. Where have you installed node and npm? Commented Sep 2, 2016 at 13:39
  • Classpath? You probably mean system path. So basically you have a project and a node installation is placed inside that project. How was it installed there exactly? Commented Sep 2, 2016 at 15:07

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

Comments

0

This is impossible.

Any executable that you run by writing its name (not including the path) is looked in some pre-defined paths.

If you'd like to run an executable located in some directory, you can execute it only by specifying its full or relative paths.

If you change dir to the containing directory, you can run it by

./executable-name

In your case

./node

2 Comments

the probleme is 'node' is called by npm script and I can't change it
I would like to run npm (and node) without install it on VM, juste by copy the node folder

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.