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)
-
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.
-
@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 runsudo npm i stylelint@latest
before runningsudo 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.
-
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.
Then, my basic CLI knowledge made me think I should add sudo so…
Any advice?
-
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.
-
@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 withnpm 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.