9 Replies Latest reply on Feb 21, 2015 1:39 AM by mhahn

    Any way to add sudo user to Galileo Gen.1?

    Olaff_69

      Hi

      Is there any way to get sudo on galileo gen.1, running the latest IOT devkit image?

       

      Im trying to set up a MEAN.js stack and install npm Yeoman, but yeoman will not let me run as root.
      Then I will have to add user with sudo, but it seems like this opkg package is only in the Edison Repo..
      Any other ways to add sudo on a galileo user?

       

      Im also facing troubles with installing Mongodb on the IOT devkit, so I have considered to change to a Debian image,
      but I guess then I can not use the Galileo-IO plugin...So im a little lost right now..

        • 1. Re: Any way to add sudo user to Galileo Gen.1?
          CMata_Intel

          Hi Olaff_69

           

          You don't need to use sudo cause you are logged in as root, could you post the error that you are receiving after trying:

          npm install Yeoman The issue could be related to npm-dependencies, so looking at the log we could see if it's a dependencies issue.

          Also, after running npm install did you have an error or it was installed successfully?

           

          Regards;

          CMata

          • 2. Re: Any way to add sudo user to Galileo Gen.1?
            mhahn
            • would "su -c" work rather than sudo?
            • you might try taking & compiling sudo from Sudo Main Page in case you don't have a Yocto build environment
            • 3. Re: Any way to add sudo user to Galileo Gen.1?
              Olaff_69

              Hi, and thanks for answer.

               

              Installing with: npm install yo -g

              It seems like it installs correctly without error messages, but when i try to run it as root i get this:

               

              Error: EACCES, permission denied '/home/root/.config'

                  at Object.fs.mkdirSync (fs.js:642:18)

                  at sync (/usr/lib/node_modules/yo/node_modules/configstore/node_modules/mkdirp/index.js:70:13)

                  at Function.sync (/usr/lib/node_modules/yo/node_modules/configstore/node_modules/mkdirp/index.js:76:24)

                  at Object.create.all.get (/usr/lib/node_modules/yo/node_modules/configstore/index.js:41:13)

                  at Object.Configstore (/usr/lib/node_modules/yo/node_modules/configstore/index.js:27:44)

                  at new Insight (/usr/lib/node_modules/yo/node_modules/insight/lib/index.js:26:34)

                  at Object.<anonymous> (/usr/lib/node_modules/yo/cli.js:123:15)

                  at Module._compile (module.js:456:26)

                  at Object.Module._extensions..js (module.js:474:10)

                  at Module.load (module.js:356:32)

              root@quark0016b9:~#

               

              I have been searching around for a solution for this, and it seems like yeoman does not allow to run as root.

              Thats why I was wondering if it was possible to register a sudo user an do all my npm installs from that user...

               

              Regards

              Olaff_69

              • 4. Re: Any way to add sudo user to Galileo Gen.1?
                CMata_Intel

                Hi Olaff_69

                 

                Which node.js version do you have in your board?

                And could you check the folders of the log ( /usr/lib/node_modules …..) ? The problem could be that you are trying to access files that are not in there.

                 

                Regards;

                Cmata

                • 5. Re: Any way to add sudo user to Galileo Gen.1?
                  mhahn

                  Olaff_69 wrote:

                   

                  Hi, and thanks for answer.

                   

                  Installing with: npm install yo -g

                  It seems like it installs correctly without error messages, but when i try to run it as root i get this:

                   

                  Error: EACCES, permission denied '/home/root/.config'

                      at Object.fs.mkdirSync (fs.js:642:18)

                      at sync (/usr/lib/node_modules/yo/node_modules/configstore/node_modules/mkdirp/index.js:70:13)

                      at Function.sync (/usr/lib/node_modules/yo/node_modules/configstore/node_modules/mkdirp/index.js:76:24)

                      at Object.create.all.get (/usr/lib/node_modules/yo/node_modules/configstore/index.js:41:13)

                      at Object.Configstore (/usr/lib/node_modules/yo/node_modules/configstore/index.js:27:44)

                      at new Insight (/usr/lib/node_modules/yo/node_modules/insight/lib/index.js:26:34)

                      at Object.<anonymous> (/usr/lib/node_modules/yo/cli.js:123:15)

                      at Module._compile (module.js:456:26)

                      at Object.Module._extensions..js (module.js:474:10)

                      at Module.load (module.js:356:32)

                  root@quark0016b9:~#

                   

                  I have been searching around for a solution for this, and it seems like yeoman does not allow to run as root.

                  Thats why I was wondering if it was possible to register a sudo user an do all my npm installs from that user...

                   

                  Regards

                  Olaff_69

                   

                  can't reproduce - successfully installed yo. Just guessing blindly: is possibly your rootfs full?

                   

                  # npm install -g yo bower grunt-cli gulp

                  [...]

                   

                  Yeoman Doctor

                  Running sanity checks on your system

                   

                   

                  ✔ Global configuration file is valid

                  ✔ No .bowerrc file in home directory

                  ✔ No .yo-rc.json file in home directory

                  ✔ NODE_PATH matches the npm root

                   

                   

                  Everything looks all right!

                  grunt-cli@0.1.13 /usr/lib/node_modules/grunt-cli

                  ├── resolve@0.3.1

                  ├── nopt@1.0.10 (abbrev@1.0.5)

                  └── findup-sync@0.1.3 (glob@3.2.11, lodash@2.4.1)

                   

                   

                  gulp@3.8.11 /usr/lib/node_modules/gulp

                  ├── v8flags@2.0.2

                  [...]

                   

                   

                  bower@1.3.12 /usr/lib/node_modules/bower

                  ├── is-root@1.0.0

                  ├── junk@1.0.0

                  [...]

                   

                  yo@1.3.3 /usr/lib/node_modules/yo

                  ├── is-root@1.0.0

                  ├── sudo-block@1.1.0

                  [...]

                  • 6. Re: Any way to add sudo user to Galileo Gen.1?
                    mhahn

                    ... a, gotcha:

                     

                    # yo --version                                     

                     

                     

                    Error: EACCES, permission denied '/home/root/.config/configstore/insight-yo.yml'

                    You don't have access to this file.

                     

                     

                        at Object.fs.openSync (evalmachine.<anonymous>:427:18)

                        at Object.fs.readFileSync (evalmachine.<anonymous>:284:15)

                        at Object.create.all.get (/usr/lib/node_modules/yo/node_modules/configstore/index.js:34:29)

                        at Object.Configstore (/usr/lib/node_modules/yo/node_modules/configstore/index.js:27:44)

                        at new Insight (/usr/lib/node_modules/yo/node_modules/insight/lib/index.js:26:34)

                        at Object.<anonymous> (/usr/lib/node_modules/yo/cli.js:123:15)

                        at Module._compile (module.js:456:26)

                        at Object.Module._extensions..js (module.js:474:10)

                        at Module.load (module.js:356:32)

                        at Function.Module._load (module.js:312:12)

                    • 7. Re: Any way to add sudo user to Galileo Gen.1?
                      mhahn

                      and as suggested by me earlier using "su -"  - everything seems to work:

                       

                      # useradd yo

                      # su - yo

                      edison:~$ whoami

                      yo

                       

                      edison:~$ yo --version

                      [?] ==========================================================================

                      We're constantly looking for ways to make yo better!

                      May we anonymously report usage statistics to improve the tool over time?

                      More info: https://github.com/yeoman/insight & http://yeoman.io

                      ==========================================================================: Yes

                      1.3.3

                      edison:~$ yo --version && bower --version && grunt --version

                      1.3.3

                      1.3.12

                      grunt-cli v0.1.13

                       

                      edison:~$ mkdir my-yo-project

                      edison:~$ cd my-yo-project/

                      edison:~/my-yo-project$ yo webapp

                       

                       

                           _-----_

                          |       |    .--------------------------.

                          |--(o)--|    |    Welcome to Yeoman,    |

                         `---------´   |   ladies and gentlemen!  |

                          ( _´U`_ )    '--------------------------'

                          /___A___\   

                           |  ~  |    

                         __'.___.'__  

                      ´   `  |° ´ Y `

                       

                       

                      Out of the box I include HTML5 Boilerplate, jQuery, and a Gruntfile.js to build your app.

                      ? What more would you like? (Press <space> to select)

                      ❯◉ Bootstrap

                      ◯ Sass

                      ◯ Modernizr

                      • 8. Re: Any way to add sudo user to Galileo Gen.1?
                        Olaff_69

                        Hi

                         

                        I tried with su -, but it gave me root at "whoami"...so I guess i did something wrong there... I also tried to build and compile Sudo, but that ended in errors as well

                        When I tried to update NodeJS with OPKG from Repo, it did not install correctly and ended with node not working, so then I gave up with Yocto!

                         

                        My solution was to go with a Debian image. That works much better for me as it is a lot of "apt-get packages" for that image that is working.

                        I was also able to install libmraa and get Galileo-IO working on Debian, so im happy

                        • 9. Re: Any way to add sudo user to Galileo Gen.1?
                          mhahn

                          ok, cool - happy it works for you no matter whether on Yocto or on Debian