Forums

No npm/node in the latest system image

It looks like node is not installed in the new glastonbury image. It was available in fishnchips. Is this an oversight, or is it gone permanently? I know we can install it using this method: https://help.pythonanywhere.com/pages/Node/, but I'd like to run npm commands from my web application, which unfortunately doesn't seem to work.

Yes, we expect node users to follow that help page.

How is it not working from your web app? How do you call it?

I call it like this:

print(subprocess.run(['npm', '--version'], capture_output=True).stdout)

I get an error:

FileNotFoundError: [Errno 2] No such file or directory: 'npm'

Just as a sanity check, when I change 'npm' to 'python', it works correctly.

Normally I need to run source ~/nvm/nvm.sh before I can use npm in the console, but in the app it doesn't work either.

FileNotFoundError: [Errno 2] No such file or directory: 'source'

I've also tried adding the shell=True parameter, but the errors are similar.