1

I installed jsx using npm:

npm install -g jsx

Now it installed jsx in this path:

/node_modules/lib/node_modules/jsx/bin

In the bin, I'm having jsx. Now if type ./jsx, it works fine as expected. But I need this compiler to get executed on a single command like jsx, I tried this:

vi ~/.bashrc

Added these:

####path for jsx
JSX_HOME=~/node_modules/lib/node_modules/jsx/bin
export JSX_HOME
PATH=$JSX_HOME/bin:$PATH

I should be able to run jsx like:

~jsx --run hello.jsx~

for that I should be able to set a path for jsx command.

PS: ./jsx inside the path works fine.

After reading the comments

I tried this

####path for jsx
    JSX_HOME=~/node_modules/lib/node_modules/jsx
    export JSX_HOME
    PATH=$JSX_HOME/bin:$PATH

Result: Not working

I tried this as well

####path for jsx
    JSX_HOME=~/node_modules/lib/node_modules/jsx/bin
    export JSX_HOME
    PATH=$JSX_HOME:$PATH

Result: Not working

  • 2
    You seem to have a double /bin in there: you are adding ~/node_modules/lib/node_modules/jsx/bin/bin to the $PATH. IS that the problem? – Celada Jun 22 '15 at 9:19
  • 1
    Did you re-login or source ~/.bashrc after your changes? – Anthon Jun 22 '15 at 9:20
  • Please verify your JSX_HOME path. $JSX_HOME=~/node_modules/lib/node_modules/jsx/bin and again you are suffixing /bin to it in the PATH. – Thushi Jun 22 '15 at 9:22
1

As folks already noted, put the /bin only in JSX_HOME or PATH, not both. Also, in .bashrc, it appears you have a tilde at the beginning of JSX_HOME. Since there wasn't one on the install path you listed, try removing that.

| improve this answer | |
  • Yes, problem with the tild symbol. You made my day :) – gates Jun 22 '15 at 9:55
  • Glad to hear it! :) – cxw Jun 22 '15 at 10:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.