Check Node -v version in ubuntu





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







-1















why is the following happening for me? :



$ node -v
v 10.15.3

$ sudo node -v
v 11.12.0


I am on Ubuntu.










share|improve this question

























  • would you mind adding some information to your question? like what commands did you run to install node, is this your PC or do you simply have a user on this pc but are not admin? this sort of information. Also the ubuntu version.

    – tatsu
    Mar 26 at 12:29











  • in addition to node version also pay attention to the environment variable NODE_PATH which determines where your npm installed modules live ... possibly you may want to create a shell wrapper to setup such variables then execute that wrapper ... also its good to avoid running node as root if possible - welcome to the forum

    – Scott Stensland
    Mar 26 at 13:45




















-1















why is the following happening for me? :



$ node -v
v 10.15.3

$ sudo node -v
v 11.12.0


I am on Ubuntu.










share|improve this question

























  • would you mind adding some information to your question? like what commands did you run to install node, is this your PC or do you simply have a user on this pc but are not admin? this sort of information. Also the ubuntu version.

    – tatsu
    Mar 26 at 12:29











  • in addition to node version also pay attention to the environment variable NODE_PATH which determines where your npm installed modules live ... possibly you may want to create a shell wrapper to setup such variables then execute that wrapper ... also its good to avoid running node as root if possible - welcome to the forum

    – Scott Stensland
    Mar 26 at 13:45
















-1












-1








-1








why is the following happening for me? :



$ node -v
v 10.15.3

$ sudo node -v
v 11.12.0


I am on Ubuntu.










share|improve this question
















why is the following happening for me? :



$ node -v
v 10.15.3

$ sudo node -v
v 11.12.0


I am on Ubuntu.







nodejs






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 26 at 12:15









tatsu

675734




675734










asked Mar 26 at 9:46









Y.P VENKYY.P VENKY

31




31













  • would you mind adding some information to your question? like what commands did you run to install node, is this your PC or do you simply have a user on this pc but are not admin? this sort of information. Also the ubuntu version.

    – tatsu
    Mar 26 at 12:29











  • in addition to node version also pay attention to the environment variable NODE_PATH which determines where your npm installed modules live ... possibly you may want to create a shell wrapper to setup such variables then execute that wrapper ... also its good to avoid running node as root if possible - welcome to the forum

    – Scott Stensland
    Mar 26 at 13:45





















  • would you mind adding some information to your question? like what commands did you run to install node, is this your PC or do you simply have a user on this pc but are not admin? this sort of information. Also the ubuntu version.

    – tatsu
    Mar 26 at 12:29











  • in addition to node version also pay attention to the environment variable NODE_PATH which determines where your npm installed modules live ... possibly you may want to create a shell wrapper to setup such variables then execute that wrapper ... also its good to avoid running node as root if possible - welcome to the forum

    – Scott Stensland
    Mar 26 at 13:45



















would you mind adding some information to your question? like what commands did you run to install node, is this your PC or do you simply have a user on this pc but are not admin? this sort of information. Also the ubuntu version.

– tatsu
Mar 26 at 12:29





would you mind adding some information to your question? like what commands did you run to install node, is this your PC or do you simply have a user on this pc but are not admin? this sort of information. Also the ubuntu version.

– tatsu
Mar 26 at 12:29













in addition to node version also pay attention to the environment variable NODE_PATH which determines where your npm installed modules live ... possibly you may want to create a shell wrapper to setup such variables then execute that wrapper ... also its good to avoid running node as root if possible - welcome to the forum

– Scott Stensland
Mar 26 at 13:45







in addition to node version also pay attention to the environment variable NODE_PATH which determines where your npm installed modules live ... possibly you may want to create a shell wrapper to setup such variables then execute that wrapper ... also its good to avoid running node as root if possible - welcome to the forum

– Scott Stensland
Mar 26 at 13:45












1 Answer
1






active

oldest

votes


















0














Firstable you have to check the path for both command:



$ which node
$ sudo which node


And you will find where the commands are executed. I think that you will see two different folders.



It happens when you install a new version over the old one from a different source, especially for NodeJS. The npm package also will show you different versions.
I would suggest you remove it completely by executing.



apt purge nodejs


Check whether you have some files left of NodeJS and npm after the removal and clean it. At the end install it again:



apt install nodejs


And enjoy it.






share|improve this answer
























  • Thank you Stefan it's working

    – Y.P VENKY
    Mar 27 at 5:48












Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1128782%2fcheck-node-v-version-in-ubuntu%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














Firstable you have to check the path for both command:



$ which node
$ sudo which node


And you will find where the commands are executed. I think that you will see two different folders.



It happens when you install a new version over the old one from a different source, especially for NodeJS. The npm package also will show you different versions.
I would suggest you remove it completely by executing.



apt purge nodejs


Check whether you have some files left of NodeJS and npm after the removal and clean it. At the end install it again:



apt install nodejs


And enjoy it.






share|improve this answer
























  • Thank you Stefan it's working

    – Y.P VENKY
    Mar 27 at 5:48
















0














Firstable you have to check the path for both command:



$ which node
$ sudo which node


And you will find where the commands are executed. I think that you will see two different folders.



It happens when you install a new version over the old one from a different source, especially for NodeJS. The npm package also will show you different versions.
I would suggest you remove it completely by executing.



apt purge nodejs


Check whether you have some files left of NodeJS and npm after the removal and clean it. At the end install it again:



apt install nodejs


And enjoy it.






share|improve this answer
























  • Thank you Stefan it's working

    – Y.P VENKY
    Mar 27 at 5:48














0












0








0







Firstable you have to check the path for both command:



$ which node
$ sudo which node


And you will find where the commands are executed. I think that you will see two different folders.



It happens when you install a new version over the old one from a different source, especially for NodeJS. The npm package also will show you different versions.
I would suggest you remove it completely by executing.



apt purge nodejs


Check whether you have some files left of NodeJS and npm after the removal and clean it. At the end install it again:



apt install nodejs


And enjoy it.






share|improve this answer













Firstable you have to check the path for both command:



$ which node
$ sudo which node


And you will find where the commands are executed. I think that you will see two different folders.



It happens when you install a new version over the old one from a different source, especially for NodeJS. The npm package also will show you different versions.
I would suggest you remove it completely by executing.



apt purge nodejs


Check whether you have some files left of NodeJS and npm after the removal and clean it. At the end install it again:



apt install nodejs


And enjoy it.







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 26 at 12:57









StefanStefan

893




893













  • Thank you Stefan it's working

    – Y.P VENKY
    Mar 27 at 5:48



















  • Thank you Stefan it's working

    – Y.P VENKY
    Mar 27 at 5:48

















Thank you Stefan it's working

– Y.P VENKY
Mar 27 at 5:48





Thank you Stefan it's working

– Y.P VENKY
Mar 27 at 5:48


















draft saved

draft discarded




















































Thanks for contributing an answer to Ask Ubuntu!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1128782%2fcheck-node-v-version-in-ubuntu%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How did Captain America manage to do this?

迪纳利

南乌拉尔铁路局