UNSOLVED Unable to install dependencies - npm not found
I’m trying to install Magic Mirror and when I type in the bash url, it says
Installing dependencies …
bash: line 112: npm: command not found
Unable to install dependencies!
Try installing node.js, and so, npm to latest stable version. Then, try the MM installer script again.
Worst case scenario, manually install MM.
I had the same issue. Node.js was on the system, but apparently not npm. I tried installing just npm with
sudo apt-get install npm, but this seemed to grab an incompatible version of npm. After this, the MagicMirror installation script got further than the first attempt, but still did not install the dependencies without error. So, don’t do that.
Instead, remove/purge Node.js and grab latest, as @Mykle1 suggests:
sudo apt-get remove --purge nodejs sudo apt autoremove curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - sudo apt-get install -y nodejs
This should install Node.js and npm. Once the installation finishes, sanity check the install with the following commands:
node -v npm -v
Then, delete the MagicMirror folder from your previous installation attempt:
rm -rf ~/MagicMirror/
And try the MagicMirror installation script again.
It installed successfully for me after this. Raspberry Pi 3 running Raspbian Stretch (in case that matters).
Thanks, that worked perfectly for me! I had the same issue.
Although now I am forced to use no Open GL driver for the MM to start up properly…well hopefully electron still doesn’t use massive amounts of CPU power to run without it now.
makepluscode last edited by makepluscode
With Rasbian of 2018-11-13, I had the same issue. So I installed only npm,
sudo apt-get install npm sudo npm install -g npm@latest
Also I used the pre-built node which is 8.x in the latest version of Rasbian.
While I install, I made a video and please check https://youtu.be/UBgH5hejYtM.
- OS : 2018-11-13-raspbian-stretch-full.img
- MagicMirror2 : 2.5.0
- MMM-Hotword : 1.1.0
- MMM-AssistantMk2 : 2.1.2