node.jssassgruntjsnode-sassincompatibility

Unclear - Unsupported node-sass with current environment


Trying to set up instance of Facebook CTF on an AWS EC2 instance running Ubuntu 16.04 and am running into the following error when doing the quick setup.

My current version of node-sass and node are

$ node -v
v15.4.0
$ npm node-sass -v
7.0.15

Interestingly, I get another vesion of node

$ npm node -v
7.0.15

The first two are supposedly compatible according to the Node Version Support Policy table on GitHub. The node version 7.0.15 is not compatible with the version of node-sass.

However, when I run grunt, it indicates an unsupported environment. Note: I have tried using individual sass commands and it works.

grunt --force
Loading "sass.js" tasks...ERROR
>> Error: Node Sass does not yet support your current environment: Linux 64-bit with Unsupported runtime (88)
>> For more information on which environments are supported please see:
>> https://github.com/sass/node-sass/releases/tag/v3.13.1

What I have tried/done-

  1. Uninstall node-sass (include using -g, clear cache, remove package-lock.json) but oddly enough, node-sass does not get uninstalled.

Questions -

  1. Why does the error log reference an older release of node-sass (v3.13.1)?
  2. How do I reconcile versions?

Does it make a difference if some packages were installed as root user vs. regular user?


Solution

  • Solved it!

    Why was I getting the error?

    1. Tracing package.json and package-locked.json files both indicate the older version "node-sass": "^3.7.0" and not the version I installed manually.

    Solution -

    1. uninstall node-sass, node
    2. delete their node_module folders
    3. run "npm install" to install any dependencies missing (node-sass and node)

    Such that now when I check the versions installed, my output is as follow -

    user@IP:/var/www/user# node -v
    v6.17.1
    user@IP:/var/www/user# npm node-sass -v
    3.10.10
    

    When reviewing the Node Sass support policy table on GitHub, these two versions are compatible. When I run grunt --force, there are no issues for node-sass.