1

I get the error mentioned above in the title, after installing http server on my OSX with

npm install http-server -g

It installed it in

/usr/local/bin/http-server -> /usr/local/lib/node_modules/http-server/bin/http-server
/usr/local/bin/hs -> /usr/local/lib/node_modules/http-server/bin/http-server
/usr/local/lib

I tried adding a path since I saw that as a suggestion here like this

 PATH=$PATH:/usr/local/lib/node_modules/http-server
2
  • I have run the wrong command instead of http-server I entered http server Commented Apr 15, 2016 at 13:07
  • @Marco did you find a solution for this? Commented Jun 5, 2016 at 8:06

2 Answers 2

1

You are on linux environment. Try This command to export path

export NODE_PATH=$NODE_PATH:/usr/local/lib/node_modules/

Then run your app.

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

Comments

1

On OS X / linux(ubuntu 16.04) environment. I solved this problem by using follow command

sudo npm -g install http-server

sudo npm install -g http-server

Comments

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.