holyredbeard
holyredbeard

Reputation: 21238

Defining paths in .bash_profile

I've been installing several Node.js modules/apps lately to be able to start a new web project. I use NPM for installing the modules, but every time I face the same problem: The modules are not accessible globally.

Not in one installation manual have I read anything about the need of changing/adding to the .bash_profile, but I have through some tutorials found out this is needed.

I have managed to get some modules working this way but not everyone, and I really could use some help here. The last one installed that I have problems with is Expresso. What shall I type in .bash_profile to be able to access it globally?

The executable Expresso file is in the following folder: /Users/toby/node/imapp/imagebridge/node_modules/expresso/bin/expresso

The following doesn't work: export PATH="/Users/toby/node/imapp/imagebridge/node_modules/expresso/bin/expresso/:$PATH"

Upvotes: 0

Views: 2508

Answers (2)

Anatoliy
Anatoliy

Reputation: 30103

Also this one is good addition for bundled modules:

export PATH="./node_modules/.bin:$PATH"

It allows you to run binaries from current working dir's node_modules subdir

Upvotes: 1

slipset
slipset

Reputation: 3078

remove espresso from your path, eg

export PATH="/Users/toby/node/imapp/imagebridge/node_modules/expresso/bin/:$PATH"

since espresso is most likely the executable. The path is a list of directories to search for executables, not a list of executables.

Upvotes: 2

Related Questions