Not able to use npm after installing yarn

0 votes

I installed yarn and now npm is not working. Whenever I try to use npm for number-is-nan, I get the following error:

Error: Cannot find module 'number-is-nan'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/index.js:2:19)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
Feb 5, 2019 in Big Data Hadoop by Kiran
1,011 views

2 answers to this question.

0 votes

Seems like installing yarn affected some files on npm. Try re-installing npm:

yarn global add npm
answered Feb 5, 2019 by Omkar
• 69,210 points
0 votes

 "The easiest way to get started is to run npm install -g yarn". But if you go to the "install yarn" page in their docs, "npm install yarn" isn't listed on any of the platform-specific installation pages, and it's only offered as the third of three options on the "Alternatives" page. Furthermore when you npm install yarn it prints a deprecation warning, "It is recommended to install Yarn using the native installation method for your environment." So my question is if npm install is the easiest installation method, why isn't it a recommended method in their docs? Are there disadvantages to installing yarn using npm

answered Feb 5, 2019 by rajesh
• 1,270 points

Yes @rk

npm install -g yarn

is easy and most of the people use it. I have been using it for some time now and I don't find any problem or disadvantage. I had the same doubt and was researching this issue. After some time, I got few points on why using platform-specific installation packages is suggested over npm.

  • npm does not give proper signature verification
  • When you install applications using npm, suppose after some time you find a better package manager, it is tedious to make the transaction from npm
  • upgrading to releases with platform-specific installation packages is easier

Related Questions In Big Data Hadoop

0 votes
1 answer

Not able to start Job History Server in Hadoop 2.8.1

You have to start JobHistoryServer process specifically ...READ MORE

answered Mar 30, 2018 in Big Data Hadoop by Ashish
• 2,650 points
2,315 views
0 votes
1 answer

Not able to find HDFS directory on my system?

I guess you didn't understand it correctly dfs.datanode.data.dir, ...READ MORE

answered Apr 17, 2018 in Big Data Hadoop by nitinrawat895
• 11,380 points
7,059 views
0 votes
1 answer

Why am I not able to see the Hadoop daemons that are running?

I guess you are starting the services ...READ MORE

answered Apr 18, 2018 in Big Data Hadoop by Shubham
• 13,490 points
786 views
0 votes
2 answers

Hadoop is not able to find jps command

jps is actually not a command of ...READ MORE

answered Apr 18, 2018 in Big Data Hadoop by Shubham
• 13,490 points
13,971 views
0 votes
1 answer

Apache Hadoop Yarn example program

You can go to this location $Yarn_Home/share/hadoop/mapreduce . You'll ...READ MORE

answered Apr 4, 2018 in Big Data Hadoop by nitinrawat895
• 11,380 points
944 views
0 votes
1 answer

What do we exactly mean by “Hadoop” – the definition of Hadoop?

The official definition of Apache Hadoop given ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by Shubham
1,609 views
+1 vote
1 answer

Hadoop Mapreduce word count Program

Firstly you need to understand the concept ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 11,380 points
10,556 views
0 votes
1 answer

hadoop.mapred vs hadoop.mapreduce?

org.apache.hadoop.mapred is the Old API  org.apache.hadoop.mapreduce is the ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 11,380 points
2,184 views
0 votes
1 answer

Hive table not able to use row format serde

Try this: create table books(isbn string, book_title string, ...READ MORE

answered Dec 31, 2018 in Big Data Hadoop by Omkar
• 69,210 points
1,153 views
0 votes
1 answer

Not able to install yarn on Ubuntu

Seems like your system does not have ...READ MORE

answered Feb 5, 2019 in Big Data Hadoop by Omkar
• 69,210 points
610 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