sassgruntjsnode-modulesnode-sassgrunt-contrib-sass

Error: Could not find an option named "sourcemap" when running SASS and Grunt


I am trying to run Grunt and SASS in order to uglify and minify javascript, CSS and SCSS. I am trying to run grunt in a RHEL8 AWS EC2 Instance and have installed the required dependencies:

NodeJS: v10.24.1

NPM: 6.14.12

Ruby: ruby 2.5.9p229 (2021-04-05 revision 67939) [x86_64-linux]

Gem: 2.7.6.3

Grunt: grunt-cli v1.4.3

SASS: 1.35.2 compiled with dart2js 2.13.4

However, when I try to run grunt, I am getting the below error:

Could not find an option named "sourcemap".

Usage: sass <input.scss> [output.css] sass <input.scss>:<output.css> :

Screenshot 1

Grunt seems to be running fine, however there seems to be some issue with SASS. This seems to work fine in my local machine. However, I cannot run grunt within the EC2 instance.

These were the commands that I used to download the dependencies:

sudo dnf install redhat-rpm-config -y
yum install -y gcc-c++ make
curl -sL https://rpm.nodesource.com/setup_10.x | sudo -E bash -
yum install nodejs -y
npm install -g grunt
yum install ruby -y
npm install -g sass

Is this any sort of dependency issue? Can someone please help?


Solution

  • I had found a way to resolve this issue. In the above question, I tried to install SASS using NPN. But instead of doing that, I tried to install SASS using Ruby-Gem.

    Following are the set of commands that I used to resolve this issue:

    curl -sSL https://rvm.io/mpapis.asc | gpg2 --import -
    curl -sSL https://rvm.io/pkuczynski.asc | gpg2 --import -
    curl -L get.rvm.io | bash -s stable
    source /etc/profile.d/rvm.sh
    rvm reload
    rvm requirements run
    rvm install 2.7
    gem install sass:3.7.4
    

    Ruby Version: 2.7
    SASS Version: 3.7.4

    By doing so, I was able to install SASS the proper way and everything worked as expected.

    Thanks!