Source Code Error Resolution for Gulp in SuiteCommerce

Resolve source code errors when running Gulp in SuiteCommerce Advanced with specific version adjustments of node-sass and gulp-sass.

·2 min read·View Oracle Docs

When deploying source files in SuiteCommerce Advanced, you might encounter the following error:

none
SOURCE CODE ERROR. Error: You may not @extend an outer selector from within @media. You may only @extend selectors within the same directive.

This error typically arises due to mismatches in node-sass versions within the package.json files located in the top-level directory and the node_modules/gulp-sass directory. Here’s how to resolve it:

Steps to Correct the Source Code Error

  1. Open Command Line: Navigate to the top-level directory of your source code.

  2. Execute Commands:

    For Windows Users:

    javascript
    1npm install -g npm
    2npm cache clear
    3npm uninstall gulp-sass
    4npm uninstall node-sass
    5npm config set save-exact true
    6npm install node-sass@3.4.1 --save
    7npm install --save gulp-sass@2.1.0

    For Linux/Mac Users:

    javascript
    1sudo npm install -g npm
    2npm cache clear
    3npm uninstall gulp-sass
    4npm uninstall node-sass
    5npm config set save-exact true
    6npm install node-sass@3.4.1 --save
    7npm install --save gulp-sass@2.1.0

    Note: These commands will modify the package.json file. Ensure you preserve these changes.

  3. Run Gulp: After completing the installations, run gulp local to verify that the source code error has been resolved.

Uninstalling Global Installations

If you installed gulp-sass globally, you might need to remove those instances:

  1. Open Command Line: Navigate to the top-level directory of your source code.

  2. Uninstall Globals:

    For Windows Users: Execute the following command:

    undefined

npm uninstall -g node-sass gulp-sass

**For Linux/Mac Users**: Execute the following commands:

sudo npm uninstall -g node-sass gulp-sass

Following these steps should help you resolve the source code error while running Gulp in SuiteCommerce Advanced.

Frequently Asked Questions (4)

What specific versions of node-sass and gulp-sass should be installed to resolve the Gulp error in SuiteCommerce Advanced?
To resolve the Gulp error, you should install node-sass version 3.4.1 and gulp-sass version 2.1.0.
Is it necessary to clear the npm cache when resolving the source code error in SuiteCommerce Advanced?
Yes, clearing the npm cache is part of the process to resolve the source code error when using Gulp in SuiteCommerce Advanced.
Do I need special permissions to execute the commands for resolving Gulp errors on a Linux/Mac system?
Yes, on Linux/Mac systems, some commands require sudo to ensure proper permissions for installation and removal of packages.
Will modifying the package.json file affect other parts of my SuiteCommerce Advanced setup?
Modifying package.json as described will affect package management for Gulp and potentially other dependencies; it’s important to ensure these changes are preserved.
Source: Source Code Error When Running Gulp Oracle NetSuite Help Center. This article was generated from official Oracle documentation and enriched with additional context and best practices.

Was this article helpful?

More in Commerce

View all Commerce articles →