SyntaxError: Unexpected token '?'

Created on 11 March 2023, over 1 year ago
Updated 4 August 2023, over 1 year ago

After a clean install: Debian 10 (nodejs and npm debian packages), Drupal 10, when I try, for first time, to execute "gulp" I get:

$gulp

/xyz/web/themes/custom/econau_barrio_sass_subtema/node_modules/sass/sass.dart.js:19
self.exports = _cliPkgExportParam ?? exports;
^

SyntaxError: Unexpected token '?'
at wrapSafe (internal/modules/cjs/loader.js:915:16)
at Module._compile (internal/modules/cjs/loader.js:963:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object. (/xyz/web/themes/custom/econau_barrio_sass_subtema/node_modules/sass/sass.default.js:1:15)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)

🐛 Bug report
Status

Active

Version

5.0

Component

Code

Created by

🇧🇶Caribbean Netherlands calbasi Catalonia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @calbasi
  • 🇦🇲Armenia Gororoik

    I got same problem today, did you fixed it?

  • 🇦🇲Armenia Gororoik

    I fixed it bro, it is new version of npm sass, u need to just downgrade it.
    sudo npm install -g sass@1.58.3
    sudo npm install --save-dev sass@1.58.3
    then run it
    that's help for me

  • If you have a this issue, you are using older Node.js version (<14).
    Delete ~ or ^ sign from package.json file.

    Use like this

    "devDependencies": {
    ...
    "sass": "^1.27.0" (Wrong)
    "sass": "1.27.0" (True)
    ...
    }

  • 🇮🇳India ravi kant Jaipur

    I did not face this type error.
    I am using as -
    Node : v16.18.1
    NPM : 8.19.2
    gulp CLI version: 2.3.0

    All working as accepted with default files in version 5.0.6.

    @calbasi Are you still facing this type error?

Production build 0.71.5 2024