user1919580
user1919580

Reputation: 151

Cant run node js as root

I have Node js running on my Raspberry pi. When I run $ node -v it gives me the version number but when I run $ sudo node -v It returns node: not found

I need to run it as root, any ideas?

Upvotes: 1

Views: 368

Answers (1)

Brad
Brad

Reputation: 163548

When you run it as root, your path is different. If you modify your path as root, or specify the full path to the Node.js executable, it will work.

Upvotes: 7

Related Questions