Installing Nodejs: sh: node: command not found error
The code I am running is as follows:
npm install -g ethereumjs-testrpc
/usr/local/bin/testrpc -> /usr/local/lib/node_modules/ethereumjs-testrpc/build/cli.node.js
The error is as follows:
sh: node: command not found
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules/ethereumjs-testrpc/node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 install: `node install`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: spawn ENOENT
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! uglifyjs-webpack-plugin@0.4.6 postinstall: `node lib/post_install.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the uglifyjs-webpack-plugin@0.4.6 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
The first step is to install nodejs and npm. Incase, you are facing node command not found then you can use the following code:
sudo apt-get update
sudo apt-get install nodejs
For npm:
sudo apt-get install npm