Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Autoprefixer doesn’t support Node v4.8.2. Update it

I have a Rails app running Rails 5.2.1 and Ruby 2.5.1. When I run the Rails server, I get the following error:

Autoprefixer doesn’t support Node v4.8.2. Update it.

When I go to the console to check the version of Node I have installed, with node -v I get:

v10.11.0

When I type nvm ls, I get:

default -> node (-> v10.11.0)
node -> stable (-> v10.11.0) (default)
stable -> 10.11 (-> v10.11.0) (default)
iojs -> N/A (default)
lts/* -> lts/carbon (-> N/A)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.14.4 (-> N/A)
lts/carbon -> v8.12.0 (-> N/A)

I've looked at other answers on Stackoverflow, and most make mention of therubyracer gem, but I don't have that gem installed for this app. Where can this version of Node be hiding and how can I delete it?

like image 281
hashrocket Avatar asked Oct 08 '18 18:10

hashrocket


1 Answers

You need to update the version of Node.js installed.

This issue was addressed here: https://github.com/ai/autoprefixer-rails/issues/144

If you have Node.js installed by NPM and your operating system package manager (such as apt, dnf, yum, or pacman), then remove the version installed by the OS package manager.

# Using apt on Debian or Ubuntu based Linux distributions
sudo apt remove nodejs

If you are using a recent version of Debian or Ubuntu you can install Node.js like so

curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs

If using a Ruby Docker container add the following before installing the nodejs package. Notice that we are not using sudo in the container.

curl -sL https://deb.nodesource.com/setup_10.x | bash -

More information on installing and updating Node.js can be found here: https://nodejs.org/en/download/package-manager

like image 51
HarlemSquirrel Avatar answered Sep 28 '22 08:09

HarlemSquirrel