How to execute Babel-node from GIT bash without typing entire link to node_modules

146 views Asked by At

The goal is to execute babel-node server.js from GIT bash without typing entire link for babel-node.

enter image description here

.bash_profile with the following:

if [ -f ~/.bashrc ]; then
   source ~/.bashrc
fi

.bashrc with the following:

export PATH=$(npm bin):$PATH

$ babel-node server.js typed into GIT bash displays:

module.js:442
    throw err;
    ^
Error: Cannot find module 'C:\Program Files\Git\Ampps\Ampps\www\nodeexpresssample\node_modules\babel-cli\bin\babel-node.js'
    at Function.Module._resolveFilename (module.js:440:15)
    at Function.Module._load (module.js:388:25)
    at Module.runMain (module.js:575:10)
    at run (bootstrap_node.js:352:7)
    at startup (bootstrap_node.js:144:9)
    at bootstrap_node.js:467:3

How am still learning my way around GIT, NPM etc...

How do I change the directory above?

1

There are 1 answers

0
lolsky On

There is a directory inside node_modules called .bin that you can reference instead for the binaries you're using.