Unable to run node commands with new user

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
0
down vote

favorite












I have two users: one old and another new. Both, my old user and my new user, can run node. But suddenly, with my new user, whenever I enter any command related to node I receive the same error copied below.



/usr/local/lib/node_modules/npm/bin/npm-cli.js:79
let notifier = require('update-notifier')(pkg)
^^^

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:374:25)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Function.Module.runMain (module.js:442:10)
at startup (node.js:136:18)
at node.js:966:3


Please help me guys. And yes, node commands are still working on my old user.







share|improve this question

















  • 2




    With what method did you install node.js?
    – MadMike
    Jun 5 at 8:56














up vote
0
down vote

favorite












I have two users: one old and another new. Both, my old user and my new user, can run node. But suddenly, with my new user, whenever I enter any command related to node I receive the same error copied below.



/usr/local/lib/node_modules/npm/bin/npm-cli.js:79
let notifier = require('update-notifier')(pkg)
^^^

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:374:25)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Function.Module.runMain (module.js:442:10)
at startup (node.js:136:18)
at node.js:966:3


Please help me guys. And yes, node commands are still working on my old user.







share|improve this question

















  • 2




    With what method did you install node.js?
    – MadMike
    Jun 5 at 8:56












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have two users: one old and another new. Both, my old user and my new user, can run node. But suddenly, with my new user, whenever I enter any command related to node I receive the same error copied below.



/usr/local/lib/node_modules/npm/bin/npm-cli.js:79
let notifier = require('update-notifier')(pkg)
^^^

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:374:25)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Function.Module.runMain (module.js:442:10)
at startup (node.js:136:18)
at node.js:966:3


Please help me guys. And yes, node commands are still working on my old user.







share|improve this question













I have two users: one old and another new. Both, my old user and my new user, can run node. But suddenly, with my new user, whenever I enter any command related to node I receive the same error copied below.



/usr/local/lib/node_modules/npm/bin/npm-cli.js:79
let notifier = require('update-notifier')(pkg)
^^^

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:374:25)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Function.Module.runMain (module.js:442:10)
at startup (node.js:136:18)
at node.js:966:3


Please help me guys. And yes, node commands are still working on my old user.









share|improve this question












share|improve this question




share|improve this question








edited Jun 5 at 8:47









MadMike

3,76372144




3,76372144









asked Jun 5 at 6:57









Arjun Agnihotri

1




1







  • 2




    With what method did you install node.js?
    – MadMike
    Jun 5 at 8:56












  • 2




    With what method did you install node.js?
    – MadMike
    Jun 5 at 8:56







2




2




With what method did you install node.js?
– MadMike
Jun 5 at 8:56




With what method did you install node.js?
– MadMike
Jun 5 at 8:56










1 Answer
1






active

oldest

votes

















up vote
0
down vote













node is the name of the Node.js snap package in all currently supported versions of Ubuntu. For example, to check your node version type:



$ node -v


To get rid of the error message in your question login as your new user and run the following command to enable npm update checking:



sudo chown -R $USER:$(id -gn $USER) /home/your-username/.config


Replace your-username in the above command with your own username.






share|improve this answer























    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',
    convertImagesToLinks: true,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    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%2f1043722%2funable-to-run-node-commands-with-new-user%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    node is the name of the Node.js snap package in all currently supported versions of Ubuntu. For example, to check your node version type:



    $ node -v


    To get rid of the error message in your question login as your new user and run the following command to enable npm update checking:



    sudo chown -R $USER:$(id -gn $USER) /home/your-username/.config


    Replace your-username in the above command with your own username.






    share|improve this answer



























      up vote
      0
      down vote













      node is the name of the Node.js snap package in all currently supported versions of Ubuntu. For example, to check your node version type:



      $ node -v


      To get rid of the error message in your question login as your new user and run the following command to enable npm update checking:



      sudo chown -R $USER:$(id -gn $USER) /home/your-username/.config


      Replace your-username in the above command with your own username.






      share|improve this answer

























        up vote
        0
        down vote










        up vote
        0
        down vote









        node is the name of the Node.js snap package in all currently supported versions of Ubuntu. For example, to check your node version type:



        $ node -v


        To get rid of the error message in your question login as your new user and run the following command to enable npm update checking:



        sudo chown -R $USER:$(id -gn $USER) /home/your-username/.config


        Replace your-username in the above command with your own username.






        share|improve this answer















        node is the name of the Node.js snap package in all currently supported versions of Ubuntu. For example, to check your node version type:



        $ node -v


        To get rid of the error message in your question login as your new user and run the following command to enable npm update checking:



        sudo chown -R $USER:$(id -gn $USER) /home/your-username/.config


        Replace your-username in the above command with your own username.







        share|improve this answer















        share|improve this answer



        share|improve this answer








        edited Jun 5 at 10:14


























        answered Jun 5 at 10:07









        karel

        49.5k11105126




        49.5k11105126






















             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1043722%2funable-to-run-node-commands-with-new-user%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            Which professions warranted travel in Medieval times?

            How do so many people here on Academia.SE, and in general, afford lavish higher education programs?

            Trouble downloading packages list due to a “Hash sum mismatch” error