Installing Nodejs sh node command not found error

+1 vote

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.

Oct 22, 2018 in Blockchain by digger
• 26,740 points
25,827 views

4 answers to this question.

0 votes
Best answer

You have to first install nodejs and npm:

Node.js

sudo apt-get update
sudo apt-get install nodejs

npm

sudo apt-get install npm
answered Oct 22, 2018 by Omkar
• 69,220 points

selected Apr 24, 2019 by Omkar
Hey! Worked for me, thanks
Not working. I installed the above mentioned without any error but still facing the same problem.

Hey @Firoz

Try adding the path as follows:

echo 'export PATH=$PATH:/usr/local/bin' >> $HOME/.bashrc
Hi @Omkar thanks for the reply. But when I install using apt-get, won't the path be set automatically?
When I tried installing using apt-get, it worked without exclusively setting the path. But because you could install it without any problem but still the error wasn't solved, I thought it could be a Path issue.
I think there was some problem with the path. Setting the path solved the problem. Thanks
Hello @Omkar. I installed the mentioned applications and also mentioned the right path. Still getting same error.

Hi @Likith. You might have to change the ownership, try this:

$ sudo chown -R $(whoami) ~/.npm
–1 vote

Try the following:

$ mean init
$ npm install


Hope it helps!!

To know more about it, enroll in Node.js training today.

Thank You!!

answered Apr 24, 2019 by Sam
0 votes

You could also try using nodejs-legacy. Try this:

$ sudo apt-get nodejs-legacy
answered Apr 24, 2019 by Giri
0 votes

I had to create a symbolic link to solve this error. Would work for you too

$ ln -s /usr/bin/nodejs /usr/bin/node
answered Apr 24, 2019 by Rishab

Related Questions In Blockchain

+1 vote
5 answers

How to solve "truffle: command not found" error in blockchain?

First try restarting the system and then ...READ MORE

answered Jul 16, 2018 in Blockchain by slayer
• 29,370 points
12,044 views
0 votes
1 answer

Getting error when i execute ./byfn.sh -m up command.

The error is caused because you're trying ...READ MORE

answered Jul 12, 2018 in Blockchain by slayer
• 29,370 points
1,106 views
0 votes
1 answer

Error during Hyperledger installation: Manifest peer latest not found

Change the tag from latest to x86_64-1.0.2 in the compose file. ...READ MORE

answered Jul 13, 2018 in Blockchain by Perry
• 17,100 points
759 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
1,957 views
0 votes
1 answer

Hyperledger Sawtooth vs Quorum in concurrency and speed Ask

Summary: Both should provide similar reliability of ...READ MORE

answered Sep 26, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
1,484 views
+1 vote
1 answer

Protocols used in a distributed/dlt system for the nodes to establish communication

yes all are over TCP/IP connections secured ...READ MORE

answered Aug 6, 2018 in Blockchain by aryya
• 7,460 points
1,490 views
0 votes
1 answer

Hyperledger Fabric peer command not found error.

This error occurs when the system can ...READ MORE

answered Jul 2, 2018 in Blockchain by Omkar
• 69,220 points
3,960 views
0 votes
1 answer

Hyperledger composer: runtime install error card not found peerAdmin

The right way to do it is: downloadFabric.sh startFabric.sh createPeerAdminCard.sh If ...READ MORE

answered Nov 5, 2018 in Blockchain by Omkar
• 69,220 points
1,211 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP