Some Guy
Some Guy

Reputation: 401

NPM not working correctly on Raspberry Pi

So I have a raspberry pi Model 3 B+ and I need NodeJS on it. It has actually been installed for a while now (2-3 weeks) and I have been building a server on it since then. NPM has worked and installed packages up until yesterday.

Yesterday, I had installed the package restify-clients, and I came back to see that NPM/Node had an incremental update (I think from 6.10.1 to 6.10.2 or something like that). So I copied the command it gave me and ran it, which I assumed would update the package. I'm choosing to believe these actions are the reason why NPM does not work anymore.

Running any npm command does not hang, it just returns like nothing was run. Running which npm returns /usr/local/bin/npm, running sudo which npm returns the same. Running npm -v returns nothing, running /usr/local/bin/npm -v returns nothing. /usr/bin/npm points to /usr/lib/node_modules/npm/bin/npm-cli.js, /usr/local/bin/npm points to /usr/local/lib/node_modules/npm/bin/npm-cli.js.

Running any command like npm init or npm install does nothing as well.

I have tried reinstalling NodeJS from nodesources twice, and both times NPM is installed into the directories but running any NPM just returns.

For extra information, running nodejs -v and node -v works and returns a version number.

Any suggestions?

Thank you.

Upvotes: 2

Views: 5731

Answers (1)

Michael Lutz
Michael Lutz

Reputation: 131

Uninstall node package and only keep nodejs, so npm should be working again.

Upvotes: 13

Related Questions