understrap / understrap

Underscores + Bootstrap = Understrap, the renowned open-source WordPress starter theme.
https://understrap.com
GNU General Public License v3.0
3.04k stars 964 forks source link

Unable to build or run understrap projects - SyntaxError: Unexpected token '?' in file node_modules/lilconfig/src/index.js:161 #2198

Open meemal opened 5 months ago

meemal commented 5 months ago

Describe the problem I'm unable to run or compile my bootstrap projects. This is affecting all understrap projects I have worked.

Debug Checklist Please include all of the following:

Error

naomispirit@Naomis-MacBook-Pro-3 psap % npm run watch

> understrap-child@1.2.0 watch /Users/naomispirit/Local Sites/psap-v2/app/public/wp-content/themes/psap
> npm-run-all --parallel watch-run-*

> understrap-child@1.2.0 watch-run-css /Users/naomispirit/Local Sites/psap-v2/app/public/wp-content/themes/psap
> nodemon --watch src/sass/ --ext scss --exec "npm-run-all css"

> understrap-child@1.2.0 watch-run-js /Users/naomispirit/Local Sites/psap-v2/app/public/wp-content/themes/psap
> nodemon --watch src/js/ --ext js --exec "npm-run-all js"

[nodemon] 2.0.22
[nodemon] 2.0.22
[nodemon] to restart at any time, enter `rs`
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): src/js/**/*
[nodemon] watching path(s): src/sass/**/*
[nodemon] watching extensions: js
[nodemon] watching extensions: scss
[nodemon] starting `npm-run-all js`
[nodemon] starting `npm-run-all css`

> understrap-child@1.2.0 js /Users/naomispirit/Local Sites/psap-v2/app/public/wp-content/themes/psap
> npm-run-all js-compile js-minify

> understrap-child@1.2.0 css /Users/naomispirit/Local Sites/psap-v2/app/public/wp-content/themes/psap
> npm-run-all css-compile css-postcss css-minify

> understrap-child@1.2.0 css-compile /Users/naomispirit/Local Sites/psap-v2/app/public/wp-content/themes/psap
> sass --style expanded --source-map --embed-sources --no-error-css --quiet src/sass/child-theme.scss:css/child-theme.css src/sass/custom-editor-style.scss:css/custom-editor-style.css

> understrap-child@1.2.0 js-compile /Users/naomispirit/Local Sites/psap-v2/app/public/wp-content/themes/psap
> rollup --config src/build/rollup.config.js --sourcemap

internal/modules/cjs/loader.js:818
  throw err;
  ^

Error: Cannot find module 'node:process'
Require stack:
- /Users/naomispirit/Local Sites/psap-v2/app/public/wp-content/themes/psap/node_modules/rollup/dist/bin/rollup
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
    at Function.Module._load (internal/modules/cjs/loader.js:667:27)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Module.<anonymous> (/Users/naomispirit/Local Sites/psap-v2/app/public/wp-content/themes/psap/node_modules/rollup/dist/bin/rollup:16:19)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    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 Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/naomispirit/Local Sites/psap-v2/app/public/wp-content/themes/psap/node_modules/rollup/dist/bin/rollup'
  ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! understrap-child@1.2.0 js-compile: `rollup --config src/build/rollup.config.js --sourcemap`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the understrap-child@1.2.0 js-compile script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/naomispirit/.npm/_logs/2024-03-28T11_48_20_934Z-debug.log
ERROR: "js-compile" exited with 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! understrap-child@1.2.0 js: `npm-run-all js-compile js-minify`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the understrap-child@1.2.0 js script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/naomispirit/.npm/_logs/2024-03-28T11_48_20_964Z-debug.log
ERROR: "js" exited with 1.
[nodemon] app crashed - waiting for file changes before starting...

> understrap-child@1.2.0 css-postcss /Users/naomispirit/Local Sites/psap-v2/app/public/wp-content/themes/psap
> postcss --config src/build/postcss.config.js --replace "css/*.css" "!css/*.rtl*.css" "!css/*.min.css"

/Users/naomispirit/Local Sites/psap-v2/app/public/wp-content/themes/psap/node_modules/lilconfig/src/index.js:161
        } = getOptions(name, options ?? {}, false);
                                      ^

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.<anonymous> (/Users/naomispirit/Local Sites/psap-v2/app/public/wp-content/themes/psap/node_modules/postcss-load-config/src/index.js:6:16)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! understrap-child@1.2.0 css-postcss: `postcss --config src/build/postcss.config.js --replace "css/*.css" "!css/*.rtl*.css" "!css/*.min.css"`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the understrap-child@1.2.0 css-postcss script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/naomispirit/.npm/_logs/2024-03-28T11_48_25_344Z-debug.log
ERROR: "css-postcss" exited with 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! understrap-child@1.2.0 css: `npm-run-all css-compile css-postcss css-minify`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the understrap-child@1.2.0 css script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/naomispirit/.npm/_logs/2024-03-28T11_48_25_372Z-debug.log
ERROR: "css" exited with 1.
[nodemon] app crashed - waiting for file changes before starting...
bacoords commented 5 months ago

[v12.22.5 ] The output of node -v

This is most likely the issue. You'll need to use a supported version of node (>18) for this project. The steps I'd recommend are