'SCSS in vscode is not recognized as an internal or external command

this is the package.json and package-lock.json code

//package.json
{
  "dependencies": {
    "scss": "^0.2.4"
  }
}
//package-lock.json
{
  "name": "PriceTable",
  "lockfileVersion": 2,
  "requires": true,
  "packages": {
    "": {
      "dependencies": {
        "scss": "^0.2.4"
      }
    },
    "node_modules/ometa": {
      "version": "0.2.2",
      "resolved": "https://registry.npmjs.org/ometa/-/ometa-0.2.2.tgz",
      "integrity": "sha1-9TxHNbptVq9aRrBN+3xDNMWW1E4=",
      "engines": {
        "node": ">= 0.2.0"
      }
    },
    "node_modules/scss": {
      "version": "0.2.4",
      "resolved": "https://registry.npmjs.org/scss/-/scss-0.2.4.tgz",
      "integrity": "sha1-BA2QPtN8XU+krTOuH9OJrBKk4GU=",
      "dependencies": {
        "ometa": "0.2.2"
      },
      "engines": {
        "node": ">= 0.2.0"
      }
    }
  },
  "dependencies": {
    "ometa": {
      "version": "0.2.2",
      "resolved": "https://registry.npmjs.org/ometa/-/ometa-0.2.2.tgz",
      "integrity": "sha1-9TxHNbptVq9aRrBN+3xDNMWW1E4="
    },
    "scss": {
      "version": "0.2.4",
      "resolved": "https://registry.npmjs.org/scss/-/scss-0.2.4.tgz",
      "integrity": "sha1-BA2QPtN8XU+krTOuH9OJrBKk4GU=",
      "requires": {
        "ometa": "0.2.2"
      }
    }
  }
}

I tried to install Sass in vscode but when I click the run button on the left corner, it shows an error like this:

"scss is not recognized as an internal or external command..."

Please someone show me whats wrong enter image description here

scss is not recogized in vscode



Solution 1:[1]

First, ensure that Node is installed and functional.To test this, run the following command and see if it produces an output without errors.Basically, it should return the node and npm versions that are currently installed on your machine.

node -v //To check the installed node version
npm -v  //To check the installed npm version

After ensuring that node and npm are installed and working properly, I recommend that you install sass globally. This could be the case in this instance.

npm install -g node-sass

And then do

  1. npm i, which in this case would be similar to npm install --save-dev node-sass
  2. npm run node-sass

Then, run your script again and examine the results.

node-sass --styled expanded "*Your file path*"

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 DharmanBot