Header

Cannot install SASS globally

Due to the way permissions work inside our build environment, the user that we use for user build commands does not have the ability to install packages globally. To prevent this error from happening, all you'll need to do is remove the -g flag from npm install.

1. Remove the global flag:
npm install sass # Remove the -g flag

2. Update your build script (if applicable):
- If you have a build script that calls the sass command directly, you don't need to change anything. The locally installed sass will be used automatically.
However, if your build script relies on the global sass binary (e.g., by calling bin/sass ), you'll need to adjust it to use the locally installed package. This might involve:
- Using the full path to the sass executable within your project's node_modules folder (e.g., ./node_modules/.bin/sass ).

-   Updating your build script to use a package manager like `npm run` or `yarn` to execute the Sass compiler. This approach is recommended as it avoids relying on specific file paths.  

Here's an example using npm run :

{
  "scripts": {
    "build": "npm run sass"
  },
  "devDependencies": {
    "sass": "^1.x.x"  # Adjust version as needed
  }
}

Then in your terminal, run npm run build to initiate the build process using the locally installed Sass.

By using a local installation, you ensure project-specific Sass versions and avoid potential conflicts with globally installed versions.

Tree

Proudly powered by Katapult. Running on 100% renewable energy.