prereqs-ubuntu.sh and npm install -g









up vote
0
down vote

favorite












I'm closely following the tutorial for installing a development environment in Linux.



1 - I tried to install the prerequisite programs using a non-sudo user and failed because it requires a sudo user to run. Ok, so maybe the prerequisites can be executed in sudo, just not the Composer. So I ran the prerequisites using a sudo user without any issues.



2 - Now I switched to a non-sudo user to run the Composer install. So I did "npm install -g composer-cli" and it failed because npm is not installed. I looked at this reference, https://docs.npmjs.com/getting-started/fixing-npm-permissions. Is this right? Is there a specific option to use. I tried option 2 and it didn't quite work for me.



Thanks!










share|improve this question

























    up vote
    0
    down vote

    favorite












    I'm closely following the tutorial for installing a development environment in Linux.



    1 - I tried to install the prerequisite programs using a non-sudo user and failed because it requires a sudo user to run. Ok, so maybe the prerequisites can be executed in sudo, just not the Composer. So I ran the prerequisites using a sudo user without any issues.



    2 - Now I switched to a non-sudo user to run the Composer install. So I did "npm install -g composer-cli" and it failed because npm is not installed. I looked at this reference, https://docs.npmjs.com/getting-started/fixing-npm-permissions. Is this right? Is there a specific option to use. I tried option 2 and it didn't quite work for me.



    Thanks!










    share|improve this question























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I'm closely following the tutorial for installing a development environment in Linux.



      1 - I tried to install the prerequisite programs using a non-sudo user and failed because it requires a sudo user to run. Ok, so maybe the prerequisites can be executed in sudo, just not the Composer. So I ran the prerequisites using a sudo user without any issues.



      2 - Now I switched to a non-sudo user to run the Composer install. So I did "npm install -g composer-cli" and it failed because npm is not installed. I looked at this reference, https://docs.npmjs.com/getting-started/fixing-npm-permissions. Is this right? Is there a specific option to use. I tried option 2 and it didn't quite work for me.



      Thanks!










      share|improve this question













      I'm closely following the tutorial for installing a development environment in Linux.



      1 - I tried to install the prerequisite programs using a non-sudo user and failed because it requires a sudo user to run. Ok, so maybe the prerequisites can be executed in sudo, just not the Composer. So I ran the prerequisites using a sudo user without any issues.



      2 - Now I switched to a non-sudo user to run the Composer install. So I did "npm install -g composer-cli" and it failed because npm is not installed. I looked at this reference, https://docs.npmjs.com/getting-started/fixing-npm-permissions. Is this right? Is there a specific option to use. I tried option 2 and it didn't quite work for me.



      Thanks!







      install ubuntu-16.04 hyperledger-composer






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Oct 23 '17 at 17:10









      rgabo101

      1




      1






















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          0
          down vote













          did you follow all of the pre-reqs from https://hyperledger.github.io/composer/unstable/installing/development-tools.html ? I only mention, because you wrote and it failed because npm is not installed.. This would mean you didn't install npm yet (and therefore your question on permissions is an entirely separate question, that may not be an issue once you have npm installed.



          In the prereqs-ubuntu.sh script it mentions (after nvm / node install):




          *# Configure nvm to use version 6.9.5
          nvm use 6.9.5
          nvm alias default 6.9.5*

          **# Install the latest version of npm
          npm install npm@latest -g**


          To resolve your particular problem, you would run the last line.



          Only use sudo where instructed in the pre-reqs-ubuntu.sh script. To re-iterate - do not install Hyperledger Composer packages - with sudo. It will cause problems, for npm (when using it for installs) and won't install properly.






          share|improve this answer



























            up vote
            0
            down vote













            Well, what I did and managed through:



            --> install nodejs and npm:



            sudo snap install node --classic --channel=8


            so you get the latest node8.



            --> then to solve "sudo" problem with node specify the npm prefix:



            npm config set prefix ~/.node_modules


            add the following to .bash_profile



            export PATH=$HOME/.node_modules/bin:$PATH


            Now the packages will install into your user directory and no permissions will be harmend.



            --> install nvm (to get exactly node 8.9 version on the next step):



            curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash


            or



            wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash


            Verify:



            node -v nvm


            which should output 'nvm' if the installation was successful.



            --> get and set node 8.9 version:



            nvm install v8.9.0 
            nvm use 8.9.0


            --> reset PATHes:
            echo export PATH="$HOME/npm/b



            in:$PATH" >> ~/.bashrc
            npm config set prefix ~/npm
            echo "export NODE_PATH=$NODE_PATH:/home/$USER/npm/lib/node_modules" >> ~/.bashrc && source ~/.bashrc


            --> reset PATHs:



            echo export PATH="$HOME/npm/bin:$PATH" >> ~/.bashrc
            npm config set prefix ~/npm
            echo "export NODE_PATH=$NODE_PATH:/home/$USER/npm/lib/node_modules" >> ~/.bashrc && source ~/.bashrc


            --> at this stage the docker previous setup shall be destroyed:



            docker kill $(docker ps -q)
            docker rm $(docker ps -aq)
            docker rmi $(docker images dev-* -q)


            --> now you can install Fabric dev. env. (assuming the rest of prereq components stand available (Docker, Docker Compose, Python, git)):



            npm install -g composer-cli 


            etc.






            share|improve this answer










            New contributor




            xao leskii is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.

















              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%2f46894892%2fprereqs-ubuntu-sh-and-npm-install-g%23new-answer', 'question_page');

              );

              Post as a guest






























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              0
              down vote













              did you follow all of the pre-reqs from https://hyperledger.github.io/composer/unstable/installing/development-tools.html ? I only mention, because you wrote and it failed because npm is not installed.. This would mean you didn't install npm yet (and therefore your question on permissions is an entirely separate question, that may not be an issue once you have npm installed.



              In the prereqs-ubuntu.sh script it mentions (after nvm / node install):




              *# Configure nvm to use version 6.9.5
              nvm use 6.9.5
              nvm alias default 6.9.5*

              **# Install the latest version of npm
              npm install npm@latest -g**


              To resolve your particular problem, you would run the last line.



              Only use sudo where instructed in the pre-reqs-ubuntu.sh script. To re-iterate - do not install Hyperledger Composer packages - with sudo. It will cause problems, for npm (when using it for installs) and won't install properly.






              share|improve this answer
























                up vote
                0
                down vote













                did you follow all of the pre-reqs from https://hyperledger.github.io/composer/unstable/installing/development-tools.html ? I only mention, because you wrote and it failed because npm is not installed.. This would mean you didn't install npm yet (and therefore your question on permissions is an entirely separate question, that may not be an issue once you have npm installed.



                In the prereqs-ubuntu.sh script it mentions (after nvm / node install):




                *# Configure nvm to use version 6.9.5
                nvm use 6.9.5
                nvm alias default 6.9.5*

                **# Install the latest version of npm
                npm install npm@latest -g**


                To resolve your particular problem, you would run the last line.



                Only use sudo where instructed in the pre-reqs-ubuntu.sh script. To re-iterate - do not install Hyperledger Composer packages - with sudo. It will cause problems, for npm (when using it for installs) and won't install properly.






                share|improve this answer






















                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  did you follow all of the pre-reqs from https://hyperledger.github.io/composer/unstable/installing/development-tools.html ? I only mention, because you wrote and it failed because npm is not installed.. This would mean you didn't install npm yet (and therefore your question on permissions is an entirely separate question, that may not be an issue once you have npm installed.



                  In the prereqs-ubuntu.sh script it mentions (after nvm / node install):




                  *# Configure nvm to use version 6.9.5
                  nvm use 6.9.5
                  nvm alias default 6.9.5*

                  **# Install the latest version of npm
                  npm install npm@latest -g**


                  To resolve your particular problem, you would run the last line.



                  Only use sudo where instructed in the pre-reqs-ubuntu.sh script. To re-iterate - do not install Hyperledger Composer packages - with sudo. It will cause problems, for npm (when using it for installs) and won't install properly.






                  share|improve this answer












                  did you follow all of the pre-reqs from https://hyperledger.github.io/composer/unstable/installing/development-tools.html ? I only mention, because you wrote and it failed because npm is not installed.. This would mean you didn't install npm yet (and therefore your question on permissions is an entirely separate question, that may not be an issue once you have npm installed.



                  In the prereqs-ubuntu.sh script it mentions (after nvm / node install):




                  *# Configure nvm to use version 6.9.5
                  nvm use 6.9.5
                  nvm alias default 6.9.5*

                  **# Install the latest version of npm
                  npm install npm@latest -g**


                  To resolve your particular problem, you would run the last line.



                  Only use sudo where instructed in the pre-reqs-ubuntu.sh script. To re-iterate - do not install Hyperledger Composer packages - with sudo. It will cause problems, for npm (when using it for installs) and won't install properly.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Oct 24 '17 at 12:27









                  Paul O'Mahony

                  5,4881412




                  5,4881412






















                      up vote
                      0
                      down vote













                      Well, what I did and managed through:



                      --> install nodejs and npm:



                      sudo snap install node --classic --channel=8


                      so you get the latest node8.



                      --> then to solve "sudo" problem with node specify the npm prefix:



                      npm config set prefix ~/.node_modules


                      add the following to .bash_profile



                      export PATH=$HOME/.node_modules/bin:$PATH


                      Now the packages will install into your user directory and no permissions will be harmend.



                      --> install nvm (to get exactly node 8.9 version on the next step):



                      curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash


                      or



                      wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash


                      Verify:



                      node -v nvm


                      which should output 'nvm' if the installation was successful.



                      --> get and set node 8.9 version:



                      nvm install v8.9.0 
                      nvm use 8.9.0


                      --> reset PATHes:
                      echo export PATH="$HOME/npm/b



                      in:$PATH" >> ~/.bashrc
                      npm config set prefix ~/npm
                      echo "export NODE_PATH=$NODE_PATH:/home/$USER/npm/lib/node_modules" >> ~/.bashrc && source ~/.bashrc


                      --> reset PATHs:



                      echo export PATH="$HOME/npm/bin:$PATH" >> ~/.bashrc
                      npm config set prefix ~/npm
                      echo "export NODE_PATH=$NODE_PATH:/home/$USER/npm/lib/node_modules" >> ~/.bashrc && source ~/.bashrc


                      --> at this stage the docker previous setup shall be destroyed:



                      docker kill $(docker ps -q)
                      docker rm $(docker ps -aq)
                      docker rmi $(docker images dev-* -q)


                      --> now you can install Fabric dev. env. (assuming the rest of prereq components stand available (Docker, Docker Compose, Python, git)):



                      npm install -g composer-cli 


                      etc.






                      share|improve this answer










                      New contributor




                      xao leskii is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.





















                        up vote
                        0
                        down vote













                        Well, what I did and managed through:



                        --> install nodejs and npm:



                        sudo snap install node --classic --channel=8


                        so you get the latest node8.



                        --> then to solve "sudo" problem with node specify the npm prefix:



                        npm config set prefix ~/.node_modules


                        add the following to .bash_profile



                        export PATH=$HOME/.node_modules/bin:$PATH


                        Now the packages will install into your user directory and no permissions will be harmend.



                        --> install nvm (to get exactly node 8.9 version on the next step):



                        curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash


                        or



                        wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash


                        Verify:



                        node -v nvm


                        which should output 'nvm' if the installation was successful.



                        --> get and set node 8.9 version:



                        nvm install v8.9.0 
                        nvm use 8.9.0


                        --> reset PATHes:
                        echo export PATH="$HOME/npm/b



                        in:$PATH" >> ~/.bashrc
                        npm config set prefix ~/npm
                        echo "export NODE_PATH=$NODE_PATH:/home/$USER/npm/lib/node_modules" >> ~/.bashrc && source ~/.bashrc


                        --> reset PATHs:



                        echo export PATH="$HOME/npm/bin:$PATH" >> ~/.bashrc
                        npm config set prefix ~/npm
                        echo "export NODE_PATH=$NODE_PATH:/home/$USER/npm/lib/node_modules" >> ~/.bashrc && source ~/.bashrc


                        --> at this stage the docker previous setup shall be destroyed:



                        docker kill $(docker ps -q)
                        docker rm $(docker ps -aq)
                        docker rmi $(docker images dev-* -q)


                        --> now you can install Fabric dev. env. (assuming the rest of prereq components stand available (Docker, Docker Compose, Python, git)):



                        npm install -g composer-cli 


                        etc.






                        share|improve this answer










                        New contributor




                        xao leskii is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                        Check out our Code of Conduct.



















                          up vote
                          0
                          down vote










                          up vote
                          0
                          down vote









                          Well, what I did and managed through:



                          --> install nodejs and npm:



                          sudo snap install node --classic --channel=8


                          so you get the latest node8.



                          --> then to solve "sudo" problem with node specify the npm prefix:



                          npm config set prefix ~/.node_modules


                          add the following to .bash_profile



                          export PATH=$HOME/.node_modules/bin:$PATH


                          Now the packages will install into your user directory and no permissions will be harmend.



                          --> install nvm (to get exactly node 8.9 version on the next step):



                          curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash


                          or



                          wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash


                          Verify:



                          node -v nvm


                          which should output 'nvm' if the installation was successful.



                          --> get and set node 8.9 version:



                          nvm install v8.9.0 
                          nvm use 8.9.0


                          --> reset PATHes:
                          echo export PATH="$HOME/npm/b



                          in:$PATH" >> ~/.bashrc
                          npm config set prefix ~/npm
                          echo "export NODE_PATH=$NODE_PATH:/home/$USER/npm/lib/node_modules" >> ~/.bashrc && source ~/.bashrc


                          --> reset PATHs:



                          echo export PATH="$HOME/npm/bin:$PATH" >> ~/.bashrc
                          npm config set prefix ~/npm
                          echo "export NODE_PATH=$NODE_PATH:/home/$USER/npm/lib/node_modules" >> ~/.bashrc && source ~/.bashrc


                          --> at this stage the docker previous setup shall be destroyed:



                          docker kill $(docker ps -q)
                          docker rm $(docker ps -aq)
                          docker rmi $(docker images dev-* -q)


                          --> now you can install Fabric dev. env. (assuming the rest of prereq components stand available (Docker, Docker Compose, Python, git)):



                          npm install -g composer-cli 


                          etc.






                          share|improve this answer










                          New contributor




                          xao leskii is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.









                          Well, what I did and managed through:



                          --> install nodejs and npm:



                          sudo snap install node --classic --channel=8


                          so you get the latest node8.



                          --> then to solve "sudo" problem with node specify the npm prefix:



                          npm config set prefix ~/.node_modules


                          add the following to .bash_profile



                          export PATH=$HOME/.node_modules/bin:$PATH


                          Now the packages will install into your user directory and no permissions will be harmend.



                          --> install nvm (to get exactly node 8.9 version on the next step):



                          curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash


                          or



                          wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash


                          Verify:



                          node -v nvm


                          which should output 'nvm' if the installation was successful.



                          --> get and set node 8.9 version:



                          nvm install v8.9.0 
                          nvm use 8.9.0


                          --> reset PATHes:
                          echo export PATH="$HOME/npm/b



                          in:$PATH" >> ~/.bashrc
                          npm config set prefix ~/npm
                          echo "export NODE_PATH=$NODE_PATH:/home/$USER/npm/lib/node_modules" >> ~/.bashrc && source ~/.bashrc


                          --> reset PATHs:



                          echo export PATH="$HOME/npm/bin:$PATH" >> ~/.bashrc
                          npm config set prefix ~/npm
                          echo "export NODE_PATH=$NODE_PATH:/home/$USER/npm/lib/node_modules" >> ~/.bashrc && source ~/.bashrc


                          --> at this stage the docker previous setup shall be destroyed:



                          docker kill $(docker ps -q)
                          docker rm $(docker ps -aq)
                          docker rmi $(docker images dev-* -q)


                          --> now you can install Fabric dev. env. (assuming the rest of prereq components stand available (Docker, Docker Compose, Python, git)):



                          npm install -g composer-cli 


                          etc.







                          share|improve this answer










                          New contributor




                          xao leskii is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.









                          share|improve this answer



                          share|improve this answer








                          edited Nov 10 at 12:12





















                          New contributor




                          xao leskii is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.









                          answered Nov 10 at 9:28









                          xao leskii

                          112




                          112




                          New contributor




                          xao leskii is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.





                          New contributor





                          xao leskii is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.






                          xao leskii is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.



























                               

                              draft saved


                              draft discarded















































                               


                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f46894892%2fprereqs-ubuntu-sh-and-npm-install-g%23new-answer', 'question_page');

                              );

                              Post as a guest














































































                              這個網誌中的熱門文章

                              Barbados

                              How to read a connectionString WITH PROVIDER in .NET Core?

                              Node.js Script on GitHub Pages or Amazon S3