error while installing “npm install -g ionic cordova”











up vote
1
down vote

favorite












When I install npm install -g ionic cordova It throws below error




npm WARN checkPermissions Missing write access to
/usr/lib/node_modules npm ERR! path /usr/lib/node_modules npm ERR!
code EACCES npm ERR! errno -13 npm ERR! syscall access npm ERR! Error:
EACCES: permission denied, access '/usr/lib/node_modules' npm ERR! {
Error: EACCES: permission denied, access '/usr/lib/node_modules' npm
ERR! stack: 'Error: EACCES: permission denied, access
'/usr/lib/node_modules'', npm ERR! errno: -13, npm ERR! code:
'EACCES', npm ERR! syscall: 'access', npm ERR! path:
'/usr/lib/node_modules' } npm ERR! npm ERR! The operation was
rejected by your operating system. npm ERR! It is likely you do not
have the permissions to access this file as the current user npm ERR!
npm ERR! If you believe this might be a permissions issue, please
double-check the npm ERR! permissions of the file and its containing
directories, or try running npm ERR! the command again as
root/Administrator (though this is not recommended).



npm ERR! A complete log of this run can be found in: npm ERR!

/home/javauser/.npm/_logs/2018-05-19T04_42_24_737Z-debug.log




I tried with root user as well.
I am using node v9.11.1 , npm 6.0.1










share|improve this question




















  • 1




    docs.npmjs.com/getting-started/fixing-npm-permissions
    – Suraj Rao
    May 19 at 5:27















up vote
1
down vote

favorite












When I install npm install -g ionic cordova It throws below error




npm WARN checkPermissions Missing write access to
/usr/lib/node_modules npm ERR! path /usr/lib/node_modules npm ERR!
code EACCES npm ERR! errno -13 npm ERR! syscall access npm ERR! Error:
EACCES: permission denied, access '/usr/lib/node_modules' npm ERR! {
Error: EACCES: permission denied, access '/usr/lib/node_modules' npm
ERR! stack: 'Error: EACCES: permission denied, access
'/usr/lib/node_modules'', npm ERR! errno: -13, npm ERR! code:
'EACCES', npm ERR! syscall: 'access', npm ERR! path:
'/usr/lib/node_modules' } npm ERR! npm ERR! The operation was
rejected by your operating system. npm ERR! It is likely you do not
have the permissions to access this file as the current user npm ERR!
npm ERR! If you believe this might be a permissions issue, please
double-check the npm ERR! permissions of the file and its containing
directories, or try running npm ERR! the command again as
root/Administrator (though this is not recommended).



npm ERR! A complete log of this run can be found in: npm ERR!

/home/javauser/.npm/_logs/2018-05-19T04_42_24_737Z-debug.log




I tried with root user as well.
I am using node v9.11.1 , npm 6.0.1










share|improve this question




















  • 1




    docs.npmjs.com/getting-started/fixing-npm-permissions
    – Suraj Rao
    May 19 at 5:27













up vote
1
down vote

favorite









up vote
1
down vote

favorite











When I install npm install -g ionic cordova It throws below error




npm WARN checkPermissions Missing write access to
/usr/lib/node_modules npm ERR! path /usr/lib/node_modules npm ERR!
code EACCES npm ERR! errno -13 npm ERR! syscall access npm ERR! Error:
EACCES: permission denied, access '/usr/lib/node_modules' npm ERR! {
Error: EACCES: permission denied, access '/usr/lib/node_modules' npm
ERR! stack: 'Error: EACCES: permission denied, access
'/usr/lib/node_modules'', npm ERR! errno: -13, npm ERR! code:
'EACCES', npm ERR! syscall: 'access', npm ERR! path:
'/usr/lib/node_modules' } npm ERR! npm ERR! The operation was
rejected by your operating system. npm ERR! It is likely you do not
have the permissions to access this file as the current user npm ERR!
npm ERR! If you believe this might be a permissions issue, please
double-check the npm ERR! permissions of the file and its containing
directories, or try running npm ERR! the command again as
root/Administrator (though this is not recommended).



npm ERR! A complete log of this run can be found in: npm ERR!

/home/javauser/.npm/_logs/2018-05-19T04_42_24_737Z-debug.log




I tried with root user as well.
I am using node v9.11.1 , npm 6.0.1










share|improve this question















When I install npm install -g ionic cordova It throws below error




npm WARN checkPermissions Missing write access to
/usr/lib/node_modules npm ERR! path /usr/lib/node_modules npm ERR!
code EACCES npm ERR! errno -13 npm ERR! syscall access npm ERR! Error:
EACCES: permission denied, access '/usr/lib/node_modules' npm ERR! {
Error: EACCES: permission denied, access '/usr/lib/node_modules' npm
ERR! stack: 'Error: EACCES: permission denied, access
'/usr/lib/node_modules'', npm ERR! errno: -13, npm ERR! code:
'EACCES', npm ERR! syscall: 'access', npm ERR! path:
'/usr/lib/node_modules' } npm ERR! npm ERR! The operation was
rejected by your operating system. npm ERR! It is likely you do not
have the permissions to access this file as the current user npm ERR!
npm ERR! If you believe this might be a permissions issue, please
double-check the npm ERR! permissions of the file and its containing
directories, or try running npm ERR! the command again as
root/Administrator (though this is not recommended).



npm ERR! A complete log of this run can be found in: npm ERR!

/home/javauser/.npm/_logs/2018-05-19T04_42_24_737Z-debug.log




I tried with root user as well.
I am using node v9.11.1 , npm 6.0.1







node.js cordova ionic-framework npm






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 19 at 11:56









Suraj Rao

22.3k75468




22.3k75468










asked May 19 at 5:20









Prashant Patel

61112




61112








  • 1




    docs.npmjs.com/getting-started/fixing-npm-permissions
    – Suraj Rao
    May 19 at 5:27














  • 1




    docs.npmjs.com/getting-started/fixing-npm-permissions
    – Suraj Rao
    May 19 at 5:27








1




1




docs.npmjs.com/getting-started/fixing-npm-permissions
– Suraj Rao
May 19 at 5:27




docs.npmjs.com/getting-started/fixing-npm-permissions
– Suraj Rao
May 19 at 5:27












2 Answers
2






active

oldest

votes

















up vote
2
down vote













run with sudo in Mac OS or linux



sudo npm install -g ionic cordova


or in windows open cmd with run as administrator



npm install -g ionic cordova





share|improve this answer





















  • This also worked for: npm install -g @angular/cli
    – ymerdrengene
    Oct 24 at 18:17


















up vote
0
down vote













Never use npm with sudo (or as root)! You can create potential backdoor to your system.






share|improve this answer





















    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    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',
    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%2fstackoverflow.com%2fquestions%2f50422042%2ferror-while-installing-npm-install-g-ionic-cordova%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    2
    down vote













    run with sudo in Mac OS or linux



    sudo npm install -g ionic cordova


    or in windows open cmd with run as administrator



    npm install -g ionic cordova





    share|improve this answer





















    • This also worked for: npm install -g @angular/cli
      – ymerdrengene
      Oct 24 at 18:17















    up vote
    2
    down vote













    run with sudo in Mac OS or linux



    sudo npm install -g ionic cordova


    or in windows open cmd with run as administrator



    npm install -g ionic cordova





    share|improve this answer





















    • This also worked for: npm install -g @angular/cli
      – ymerdrengene
      Oct 24 at 18:17













    up vote
    2
    down vote










    up vote
    2
    down vote









    run with sudo in Mac OS or linux



    sudo npm install -g ionic cordova


    or in windows open cmd with run as administrator



    npm install -g ionic cordova





    share|improve this answer












    run with sudo in Mac OS or linux



    sudo npm install -g ionic cordova


    or in windows open cmd with run as administrator



    npm install -g ionic cordova






    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered May 19 at 6:34







    user9793769



















    • This also worked for: npm install -g @angular/cli
      – ymerdrengene
      Oct 24 at 18:17


















    • This also worked for: npm install -g @angular/cli
      – ymerdrengene
      Oct 24 at 18:17
















    This also worked for: npm install -g @angular/cli
    – ymerdrengene
    Oct 24 at 18:17




    This also worked for: npm install -g @angular/cli
    – ymerdrengene
    Oct 24 at 18:17












    up vote
    0
    down vote













    Never use npm with sudo (or as root)! You can create potential backdoor to your system.






    share|improve this answer

























      up vote
      0
      down vote













      Never use npm with sudo (or as root)! You can create potential backdoor to your system.






      share|improve this answer























        up vote
        0
        down vote










        up vote
        0
        down vote









        Never use npm with sudo (or as root)! You can create potential backdoor to your system.






        share|improve this answer












        Never use npm with sudo (or as root)! You can create potential backdoor to your system.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 19 at 9:19









        Ondrej

        62




        62






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • 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.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • 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%2fstackoverflow.com%2fquestions%2f50422042%2ferror-while-installing-npm-install-g-ionic-cordova%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

            Paul Cézanne

            UIScrollView CustomStickyHeader Resize height generates problems when scroll is too fast

            Angular material date-picker (MatDatepicker) auto completes the date on focus out