MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    Error when running sudo npm install. magicmirror@2.3.1 cd vendor && yon install (wd=/home/pi/MagicMirror)

    Scheduled Pinned Locked Moved Troubleshooting
    5 Posts 3 Posters 2.3k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G Offline
      greenwaydev
      last edited by

      I am trying to get Magic Mirror running on my Pi Zero W headless. I have followed a few different tutorials, mostly saying the same stuff, and I was able to get Magic Mirror, Node, and npm installed fine, but when I run “sudo npm install” I get the error pictured below. I thought it was because nodejs was not up to date, but I have updated it and it is still not working.

      0_1524507375482_Screen Shot 2018-04-23 at 2.07.34 PM.png

      1 Reply Last reply Reply Quote 0
      • PatexP Offline
        Patex
        last edited by

        @greenwaydev said in Error when running sudo npm install. magicmirror@2.3.1 cd vendor && yon install (wd=/home/pi/MagicMirror):

        Magic Mirror running on my Pi Zero W headless. I have followed a few different tutorials, mostly saying the same stuff, and I was

        The error occurs due to incompatible peer dependencies. Npm (recently) introduced the concept of peer dependencies which are dependencies expected to be provided separately to ensure compatibility between different apis.

        I am surprised that in your case mm fails to finish the installation as for me I only get a warning.

        My attempt to fix this would be to:
        For now try run sudo npm i stylelint@latest before running sudo npm install

        If this does not work change the config file to include "stylelint": "^9.0.0" instead of "stylelint": "^8.4.0" and try again.

        Be aware that you usually should never do the second step if you don’t exactly know what you are doing. Upgrading a major version (the version number at the very beginning) indicates a new release with potential api breaking changes. (If semversioning is used). But since your error log indicates that stylelint config is happy with either version, and the dependency is not really used “in production” this might be worth a shot.

        1 Reply Last reply Reply Quote 0
        • G Offline
          greenwaydev
          last edited by

          Ok I did what you said and it told me that nodejs needed to be a more recent version so I updated it again to a version that is acceptable. This is the error I am getting now.

          0_1524526014108_Screen Shot 2018-04-23 at 7.26.09 PM.png

          Then, my basic CLI knowledge made me think I should add sudo so…

          0_1524526077438_Screen Shot 2018-04-23 at 7.26.27 PM.png

          Any advice?

          1 Reply Last reply Reply Quote 0
          • Mykle1M Offline
            Mykle1 Project Sponsor Module Developer
            last edited by

            I could be mistaken but I believe that using sudo npm install can cause problems. Installation of MM and its dependencies should be done as a normal user.

            For what it’s worth.

            Create a working config
            How to add modules

            PatexP 1 Reply Last reply Reply Quote 0
            • PatexP Offline
              Patex @Mykle1
              last edited by

              @Mykle1 said in Error when running sudo npm install. magicmirror@2.3.1 cd vendor && yon install (wd=/home/pi/MagicMirror):

              I could be mistaken but I believe that using sudo npm install can cause problems. Installation of MM and its dependencies should be done as a normal user.

              For what it’s worth.

              Good point. I just saw his sudo npm install and followed along without thinking.
              You can try to uninstall stylelint again with npm uninstall stylelint(with or without sudo , whatever works) and install it again without the sudo command.
              If this does not yield any success in this issue someone fixed a similar warning (https://github.com/KraigM/homebridge-harmonyhub/issues/97).
              Never the less this shouldn’t all be necessary. Maybe it’s time to start over frech again and really be cautious about every step you do.

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post
              Enjoying MagicMirror? Please consider a donation!
              MagicMirror created by Michael Teeuw.
              Forum managed by Sam, technical setup by Karsten.
              This forum is using NodeBB as its core | Contributors
              Contact | Privacy Policy