mtness
mtness

Reputation: 1024

bash on ubuntu on windows run npm command gives error "/usr/bin/env: node: No such file or directory"

When trying to install npm on "bash on ubuntu on windows", it installs, but every call to npm or whatever results in the error:

"/usr/bin/env: node: No such file or directory"

How to solve this?

Upvotes: 0

Views: 1202

Answers (1)

mtness
mtness

Reputation: 1024

This is often a misnaming error, if you install from a package manager you bin may be called nodejs so you just need to symlink it.

In "bash on ubuntu on windows", one has to run it with sudo:

sudo ln -s /usr/bin/nodejs /usr/bin/node

Originally found here: https://github.com/nodejs/node-v0.x-archive/issues/3911
(Thanks, digitalmediums)

Upvotes: 1

Related Questions