Command not found when executing node.js n package on sudo The Next CEO of Stack...

Return the Closest Prime Number

Preparing Indesign booklet with .psd graphics for print

Is it possible to search for a directory/file combination?

Unreliable Magic - Is it worth it?

At which OSI layer a user-generated data resides?

Why does standard notation not preserve intervals (visually)

What connection does MS Office have to Netscape Navigator?

Would this house-rule that treats advantage as a +1 to the roll instead (and disadvantage as -1) and allows them to stack be balanced?

How do we know the LHC results are robust?

Do I need to enable Dev Hub in my PROD Org?

Why is the US ranked as #45 in Press Freedom ratings, despite its extremely permissive free speech laws?

Why am I allowed to create multiple unique pointers from a single object?

How do I go from 300 unfinished/half written blog posts, to published posts?

Different harmonic changes implied by a simple descending scale

Which tube will fit a -(700 x 25c) wheel?

Can we say or write : "No, it'sn't"?

Workaholic Formal/Informal

What can we do to stop prior company from asking us questions?

Written every which way

Are there any unintended negative consequences to allowing PCs to gain multiple levels at once in a short milestone-XP game?

Example of a Mathematician/Physicist whose Other Publications during their PhD eclipsed their PhD Thesis

Elegant way to replace substring in a regex with optional groups in Python?

What does "Its cash flow is deeply negative" mean?

In excess I'm lethal



Command not found when executing node.js n package on sudo



The Next CEO of Stack OverflowForever cannot be installedEhterpad configure script not finding the existing dir given via prefix optionProblem with Node.js installationinstalling node.js not workingCan't update npm version EACCES --> npm update -gError with Node and Gulpgetting error for knife bootstrap on ubuntu chef nodeNeed help fixing Segmentation FaultI am getting an error when I am checking npm versionGetting error while installing node.js in ubuntu 16.04












12















I'm trying to update my version of node to the latest stable.



Using this resource I was able to:



sudo npm install n -g


But when I try



sudo npm n stable


I get:



sudo: n: command not found


If I run n stable, the command is present:



n stable
mkdir: cannot create directory ‘/usr/local/n’: Permission denied
mkdir: cannot create directory ‘/usr/local/n’: Permission denied
mkdir: cannot create directory ‘/usr/local/n’: Permission denied
mkdir: cannot create directory ‘/usr/local/n’: Permission denied

install : node-v0.12.2
mkdir : /usr/local/n/versions/node/0.12.2
mkdir: cannot create directory ‘/usr/local/n’: Permission denied

Error: sudo required









share|improve this question

























  • Nice idea, but when I do that it returns me 'n: command not found', even though I've dropped the 'sudo'

    – JonRed
    Apr 13 '15 at 8:15











  • sudo sh -c "PATH=$PATH; n stable" <new line> sh: 1: n: not found

    – JonRed
    Apr 13 '15 at 8:19













  • No output at all. That's depresssing :-(

    – JonRed
    Apr 13 '15 at 8:20













  • Let us continue this discussion in chat.

    – JonRed
    Apr 13 '15 at 8:21











  • Please post the output of ls /usr/local/bin/n

    – Helio
    Apr 13 '15 at 8:41
















12















I'm trying to update my version of node to the latest stable.



Using this resource I was able to:



sudo npm install n -g


But when I try



sudo npm n stable


I get:



sudo: n: command not found


If I run n stable, the command is present:



n stable
mkdir: cannot create directory ‘/usr/local/n’: Permission denied
mkdir: cannot create directory ‘/usr/local/n’: Permission denied
mkdir: cannot create directory ‘/usr/local/n’: Permission denied
mkdir: cannot create directory ‘/usr/local/n’: Permission denied

install : node-v0.12.2
mkdir : /usr/local/n/versions/node/0.12.2
mkdir: cannot create directory ‘/usr/local/n’: Permission denied

Error: sudo required









share|improve this question

























  • Nice idea, but when I do that it returns me 'n: command not found', even though I've dropped the 'sudo'

    – JonRed
    Apr 13 '15 at 8:15











  • sudo sh -c "PATH=$PATH; n stable" <new line> sh: 1: n: not found

    – JonRed
    Apr 13 '15 at 8:19













  • No output at all. That's depresssing :-(

    – JonRed
    Apr 13 '15 at 8:20













  • Let us continue this discussion in chat.

    – JonRed
    Apr 13 '15 at 8:21











  • Please post the output of ls /usr/local/bin/n

    – Helio
    Apr 13 '15 at 8:41














12












12








12


6






I'm trying to update my version of node to the latest stable.



Using this resource I was able to:



sudo npm install n -g


But when I try



sudo npm n stable


I get:



sudo: n: command not found


If I run n stable, the command is present:



n stable
mkdir: cannot create directory ‘/usr/local/n’: Permission denied
mkdir: cannot create directory ‘/usr/local/n’: Permission denied
mkdir: cannot create directory ‘/usr/local/n’: Permission denied
mkdir: cannot create directory ‘/usr/local/n’: Permission denied

install : node-v0.12.2
mkdir : /usr/local/n/versions/node/0.12.2
mkdir: cannot create directory ‘/usr/local/n’: Permission denied

Error: sudo required









share|improve this question
















I'm trying to update my version of node to the latest stable.



Using this resource I was able to:



sudo npm install n -g


But when I try



sudo npm n stable


I get:



sudo: n: command not found


If I run n stable, the command is present:



n stable
mkdir: cannot create directory ‘/usr/local/n’: Permission denied
mkdir: cannot create directory ‘/usr/local/n’: Permission denied
mkdir: cannot create directory ‘/usr/local/n’: Permission denied
mkdir: cannot create directory ‘/usr/local/n’: Permission denied

install : node-v0.12.2
mkdir : /usr/local/n/versions/node/0.12.2
mkdir: cannot create directory ‘/usr/local/n’: Permission denied

Error: sudo required






14.04 nodejs






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 13 '15 at 9:17









A.B.

69.7k12172266




69.7k12172266










asked Apr 13 '15 at 8:07









JonRedJonRed

163117




163117













  • Nice idea, but when I do that it returns me 'n: command not found', even though I've dropped the 'sudo'

    – JonRed
    Apr 13 '15 at 8:15











  • sudo sh -c "PATH=$PATH; n stable" <new line> sh: 1: n: not found

    – JonRed
    Apr 13 '15 at 8:19













  • No output at all. That's depresssing :-(

    – JonRed
    Apr 13 '15 at 8:20













  • Let us continue this discussion in chat.

    – JonRed
    Apr 13 '15 at 8:21











  • Please post the output of ls /usr/local/bin/n

    – Helio
    Apr 13 '15 at 8:41



















  • Nice idea, but when I do that it returns me 'n: command not found', even though I've dropped the 'sudo'

    – JonRed
    Apr 13 '15 at 8:15











  • sudo sh -c "PATH=$PATH; n stable" <new line> sh: 1: n: not found

    – JonRed
    Apr 13 '15 at 8:19













  • No output at all. That's depresssing :-(

    – JonRed
    Apr 13 '15 at 8:20













  • Let us continue this discussion in chat.

    – JonRed
    Apr 13 '15 at 8:21











  • Please post the output of ls /usr/local/bin/n

    – Helio
    Apr 13 '15 at 8:41

















Nice idea, but when I do that it returns me 'n: command not found', even though I've dropped the 'sudo'

– JonRed
Apr 13 '15 at 8:15





Nice idea, but when I do that it returns me 'n: command not found', even though I've dropped the 'sudo'

– JonRed
Apr 13 '15 at 8:15













sudo sh -c "PATH=$PATH; n stable" <new line> sh: 1: n: not found

– JonRed
Apr 13 '15 at 8:19







sudo sh -c "PATH=$PATH; n stable" <new line> sh: 1: n: not found

– JonRed
Apr 13 '15 at 8:19















No output at all. That's depresssing :-(

– JonRed
Apr 13 '15 at 8:20







No output at all. That's depresssing :-(

– JonRed
Apr 13 '15 at 8:20















Let us continue this discussion in chat.

– JonRed
Apr 13 '15 at 8:21





Let us continue this discussion in chat.

– JonRed
Apr 13 '15 at 8:21













Please post the output of ls /usr/local/bin/n

– Helio
Apr 13 '15 at 8:41





Please post the output of ls /usr/local/bin/n

– Helio
Apr 13 '15 at 8:41










4 Answers
4






active

oldest

votes


















5














Surprisingly, your npm installation has the global prefix in a folder called npm on your home directory, this means that any package installed with the -g flag will install on this folder.



You can change this folder to any folder that is on the sudo safe path following these steps:





Graphical way:




  1. Open a File Manager (a.k.a Nautilus).

  2. Navigate to your home folder.

  3. Press Ctrl+H to show hidden files.

  4. Open a file called .npmrc with your favorite text editor.


  5. Find a line on that file with this content:



    prefix=/home/<your_username>/npm


  6. Replace /home/<your_username>/npm by a safe path (such as /usr/local/bin).


  7. Once replaced it will look like this:



    prefix=/usr/local/bin


  8. Save the file.

  9. Run again sudo npm install n -g




Terminal way:



Run this command:



sed -i.bak "s%^prefix=.*$%prefix=/usr/local/bin%" ~/.npmrc





share|improve this answer


























  • I think this nailed it! It also helped me just now when I updated my npm version, but wouldn' t recognise it. So, accepted, and thank you!

    – JonRed
    Apr 19 '15 at 19:19











  • Didnt help, still same isssue :/

    – Luckylooke
    Jul 6 '15 at 14:53











  • This helped me! I didn't have ~/.npmrc file, so I added it and now it works fine

    – Kirill Gusyatin
    Sep 6 '16 at 12:10






  • 2





    Beware: this will undo Option 2 of fixing NPM permissions

    – Edson Horacio Junior
    Jan 10 '17 at 21:55





















20














I have found solution which worked for me:



sudo -E env "PATH=$PATH" n stable


Found it here: https://stackoverflow.com/a/29400598/861615






share|improve this answer


























  • env: n: No such file or directory

    – user3311522
    Jul 15 '16 at 19:10











  • @user3311522 did you use: sudo npm install n -g before sudo -E env "PATH=$PATH" n stable ??

    – Luckylooke
    Jul 17 '16 at 19:13





















2














I know this is an Ubuntu forum, but I'm sure this will help someone with the same problem on the RHEL flavours who Googled to here like I did. Perhaps it also works in Ubuntu.



This is the approach:



ln -s /usr/local/bin/n /usr/bin/n





share|improve this answer































    0














    To avoid messing up with the .npm-global folder as noted by @Edson Horacio Junior, and based on @pohest's answer, here is how I fixed it:



    sudo ln -s /home/<username>/.npm-global/bin/n /usr/local/bin/n
    sudo n --version # test it


    As a note, this probably will not work if you haven't followed npm's steps for changing the default global directory.





    share
























      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%2f608661%2fcommand-not-found-when-executing-node-js-n-package-on-sudo%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      4 Answers
      4






      active

      oldest

      votes








      4 Answers
      4






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      5














      Surprisingly, your npm installation has the global prefix in a folder called npm on your home directory, this means that any package installed with the -g flag will install on this folder.



      You can change this folder to any folder that is on the sudo safe path following these steps:





      Graphical way:




      1. Open a File Manager (a.k.a Nautilus).

      2. Navigate to your home folder.

      3. Press Ctrl+H to show hidden files.

      4. Open a file called .npmrc with your favorite text editor.


      5. Find a line on that file with this content:



        prefix=/home/<your_username>/npm


      6. Replace /home/<your_username>/npm by a safe path (such as /usr/local/bin).


      7. Once replaced it will look like this:



        prefix=/usr/local/bin


      8. Save the file.

      9. Run again sudo npm install n -g




      Terminal way:



      Run this command:



      sed -i.bak "s%^prefix=.*$%prefix=/usr/local/bin%" ~/.npmrc





      share|improve this answer


























      • I think this nailed it! It also helped me just now when I updated my npm version, but wouldn' t recognise it. So, accepted, and thank you!

        – JonRed
        Apr 19 '15 at 19:19











      • Didnt help, still same isssue :/

        – Luckylooke
        Jul 6 '15 at 14:53











      • This helped me! I didn't have ~/.npmrc file, so I added it and now it works fine

        – Kirill Gusyatin
        Sep 6 '16 at 12:10






      • 2





        Beware: this will undo Option 2 of fixing NPM permissions

        – Edson Horacio Junior
        Jan 10 '17 at 21:55


















      5














      Surprisingly, your npm installation has the global prefix in a folder called npm on your home directory, this means that any package installed with the -g flag will install on this folder.



      You can change this folder to any folder that is on the sudo safe path following these steps:





      Graphical way:




      1. Open a File Manager (a.k.a Nautilus).

      2. Navigate to your home folder.

      3. Press Ctrl+H to show hidden files.

      4. Open a file called .npmrc with your favorite text editor.


      5. Find a line on that file with this content:



        prefix=/home/<your_username>/npm


      6. Replace /home/<your_username>/npm by a safe path (such as /usr/local/bin).


      7. Once replaced it will look like this:



        prefix=/usr/local/bin


      8. Save the file.

      9. Run again sudo npm install n -g




      Terminal way:



      Run this command:



      sed -i.bak "s%^prefix=.*$%prefix=/usr/local/bin%" ~/.npmrc





      share|improve this answer


























      • I think this nailed it! It also helped me just now when I updated my npm version, but wouldn' t recognise it. So, accepted, and thank you!

        – JonRed
        Apr 19 '15 at 19:19











      • Didnt help, still same isssue :/

        – Luckylooke
        Jul 6 '15 at 14:53











      • This helped me! I didn't have ~/.npmrc file, so I added it and now it works fine

        – Kirill Gusyatin
        Sep 6 '16 at 12:10






      • 2





        Beware: this will undo Option 2 of fixing NPM permissions

        – Edson Horacio Junior
        Jan 10 '17 at 21:55
















      5












      5








      5







      Surprisingly, your npm installation has the global prefix in a folder called npm on your home directory, this means that any package installed with the -g flag will install on this folder.



      You can change this folder to any folder that is on the sudo safe path following these steps:





      Graphical way:




      1. Open a File Manager (a.k.a Nautilus).

      2. Navigate to your home folder.

      3. Press Ctrl+H to show hidden files.

      4. Open a file called .npmrc with your favorite text editor.


      5. Find a line on that file with this content:



        prefix=/home/<your_username>/npm


      6. Replace /home/<your_username>/npm by a safe path (such as /usr/local/bin).


      7. Once replaced it will look like this:



        prefix=/usr/local/bin


      8. Save the file.

      9. Run again sudo npm install n -g




      Terminal way:



      Run this command:



      sed -i.bak "s%^prefix=.*$%prefix=/usr/local/bin%" ~/.npmrc





      share|improve this answer















      Surprisingly, your npm installation has the global prefix in a folder called npm on your home directory, this means that any package installed with the -g flag will install on this folder.



      You can change this folder to any folder that is on the sudo safe path following these steps:





      Graphical way:




      1. Open a File Manager (a.k.a Nautilus).

      2. Navigate to your home folder.

      3. Press Ctrl+H to show hidden files.

      4. Open a file called .npmrc with your favorite text editor.


      5. Find a line on that file with this content:



        prefix=/home/<your_username>/npm


      6. Replace /home/<your_username>/npm by a safe path (such as /usr/local/bin).


      7. Once replaced it will look like this:



        prefix=/usr/local/bin


      8. Save the file.

      9. Run again sudo npm install n -g




      Terminal way:



      Run this command:



      sed -i.bak "s%^prefix=.*$%prefix=/usr/local/bin%" ~/.npmrc






      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Apr 14 '15 at 19:35

























      answered Apr 14 '15 at 19:12









      HelioHelio

      5,44432950




      5,44432950













      • I think this nailed it! It also helped me just now when I updated my npm version, but wouldn' t recognise it. So, accepted, and thank you!

        – JonRed
        Apr 19 '15 at 19:19











      • Didnt help, still same isssue :/

        – Luckylooke
        Jul 6 '15 at 14:53











      • This helped me! I didn't have ~/.npmrc file, so I added it and now it works fine

        – Kirill Gusyatin
        Sep 6 '16 at 12:10






      • 2





        Beware: this will undo Option 2 of fixing NPM permissions

        – Edson Horacio Junior
        Jan 10 '17 at 21:55





















      • I think this nailed it! It also helped me just now when I updated my npm version, but wouldn' t recognise it. So, accepted, and thank you!

        – JonRed
        Apr 19 '15 at 19:19











      • Didnt help, still same isssue :/

        – Luckylooke
        Jul 6 '15 at 14:53











      • This helped me! I didn't have ~/.npmrc file, so I added it and now it works fine

        – Kirill Gusyatin
        Sep 6 '16 at 12:10






      • 2





        Beware: this will undo Option 2 of fixing NPM permissions

        – Edson Horacio Junior
        Jan 10 '17 at 21:55



















      I think this nailed it! It also helped me just now when I updated my npm version, but wouldn' t recognise it. So, accepted, and thank you!

      – JonRed
      Apr 19 '15 at 19:19





      I think this nailed it! It also helped me just now when I updated my npm version, but wouldn' t recognise it. So, accepted, and thank you!

      – JonRed
      Apr 19 '15 at 19:19













      Didnt help, still same isssue :/

      – Luckylooke
      Jul 6 '15 at 14:53





      Didnt help, still same isssue :/

      – Luckylooke
      Jul 6 '15 at 14:53













      This helped me! I didn't have ~/.npmrc file, so I added it and now it works fine

      – Kirill Gusyatin
      Sep 6 '16 at 12:10





      This helped me! I didn't have ~/.npmrc file, so I added it and now it works fine

      – Kirill Gusyatin
      Sep 6 '16 at 12:10




      2




      2





      Beware: this will undo Option 2 of fixing NPM permissions

      – Edson Horacio Junior
      Jan 10 '17 at 21:55







      Beware: this will undo Option 2 of fixing NPM permissions

      – Edson Horacio Junior
      Jan 10 '17 at 21:55















      20














      I have found solution which worked for me:



      sudo -E env "PATH=$PATH" n stable


      Found it here: https://stackoverflow.com/a/29400598/861615






      share|improve this answer


























      • env: n: No such file or directory

        – user3311522
        Jul 15 '16 at 19:10











      • @user3311522 did you use: sudo npm install n -g before sudo -E env "PATH=$PATH" n stable ??

        – Luckylooke
        Jul 17 '16 at 19:13


















      20














      I have found solution which worked for me:



      sudo -E env "PATH=$PATH" n stable


      Found it here: https://stackoverflow.com/a/29400598/861615






      share|improve this answer


























      • env: n: No such file or directory

        – user3311522
        Jul 15 '16 at 19:10











      • @user3311522 did you use: sudo npm install n -g before sudo -E env "PATH=$PATH" n stable ??

        – Luckylooke
        Jul 17 '16 at 19:13
















      20












      20








      20







      I have found solution which worked for me:



      sudo -E env "PATH=$PATH" n stable


      Found it here: https://stackoverflow.com/a/29400598/861615






      share|improve this answer















      I have found solution which worked for me:



      sudo -E env "PATH=$PATH" n stable


      Found it here: https://stackoverflow.com/a/29400598/861615







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited May 23 '17 at 12:39









      Community

      1




      1










      answered Jul 6 '15 at 15:00









      LuckylookeLuckylooke

      30125




      30125













      • env: n: No such file or directory

        – user3311522
        Jul 15 '16 at 19:10











      • @user3311522 did you use: sudo npm install n -g before sudo -E env "PATH=$PATH" n stable ??

        – Luckylooke
        Jul 17 '16 at 19:13





















      • env: n: No such file or directory

        – user3311522
        Jul 15 '16 at 19:10











      • @user3311522 did you use: sudo npm install n -g before sudo -E env "PATH=$PATH" n stable ??

        – Luckylooke
        Jul 17 '16 at 19:13



















      env: n: No such file or directory

      – user3311522
      Jul 15 '16 at 19:10





      env: n: No such file or directory

      – user3311522
      Jul 15 '16 at 19:10













      @user3311522 did you use: sudo npm install n -g before sudo -E env "PATH=$PATH" n stable ??

      – Luckylooke
      Jul 17 '16 at 19:13







      @user3311522 did you use: sudo npm install n -g before sudo -E env "PATH=$PATH" n stable ??

      – Luckylooke
      Jul 17 '16 at 19:13













      2














      I know this is an Ubuntu forum, but I'm sure this will help someone with the same problem on the RHEL flavours who Googled to here like I did. Perhaps it also works in Ubuntu.



      This is the approach:



      ln -s /usr/local/bin/n /usr/bin/n





      share|improve this answer




























        2














        I know this is an Ubuntu forum, but I'm sure this will help someone with the same problem on the RHEL flavours who Googled to here like I did. Perhaps it also works in Ubuntu.



        This is the approach:



        ln -s /usr/local/bin/n /usr/bin/n





        share|improve this answer


























          2












          2








          2







          I know this is an Ubuntu forum, but I'm sure this will help someone with the same problem on the RHEL flavours who Googled to here like I did. Perhaps it also works in Ubuntu.



          This is the approach:



          ln -s /usr/local/bin/n /usr/bin/n





          share|improve this answer













          I know this is an Ubuntu forum, but I'm sure this will help someone with the same problem on the RHEL flavours who Googled to here like I did. Perhaps it also works in Ubuntu.



          This is the approach:



          ln -s /usr/local/bin/n /usr/bin/n






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Aug 5 '17 at 19:52









          poshestposhest

          1211




          1211























              0














              To avoid messing up with the .npm-global folder as noted by @Edson Horacio Junior, and based on @pohest's answer, here is how I fixed it:



              sudo ln -s /home/<username>/.npm-global/bin/n /usr/local/bin/n
              sudo n --version # test it


              As a note, this probably will not work if you haven't followed npm's steps for changing the default global directory.





              share




























                0














                To avoid messing up with the .npm-global folder as noted by @Edson Horacio Junior, and based on @pohest's answer, here is how I fixed it:



                sudo ln -s /home/<username>/.npm-global/bin/n /usr/local/bin/n
                sudo n --version # test it


                As a note, this probably will not work if you haven't followed npm's steps for changing the default global directory.





                share


























                  0












                  0








                  0







                  To avoid messing up with the .npm-global folder as noted by @Edson Horacio Junior, and based on @pohest's answer, here is how I fixed it:



                  sudo ln -s /home/<username>/.npm-global/bin/n /usr/local/bin/n
                  sudo n --version # test it


                  As a note, this probably will not work if you haven't followed npm's steps for changing the default global directory.





                  share













                  To avoid messing up with the .npm-global folder as noted by @Edson Horacio Junior, and based on @pohest's answer, here is how I fixed it:



                  sudo ln -s /home/<username>/.npm-global/bin/n /usr/local/bin/n
                  sudo n --version # test it


                  As a note, this probably will not work if you haven't followed npm's steps for changing the default global directory.






                  share











                  share


                  share










                  answered 4 mins ago









                  GusGus

                  173119




                  173119






























                      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%2f608661%2fcommand-not-found-when-executing-node-js-n-package-on-sudo%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

                      Is there a lightweight tool to crop images quickly?Cropping Images using Command Line Tools OnlyHow to crop...

                      Unit packagekit.service is masked Announcing the arrival of Valued Associate #679: Cesar...

                      List of shipwrecks in 1808...