understrap / understrap-child

The starter child theme for Understrap, the renowned open-source WordPress starter theme.
GNU General Public License v3.0
582 stars 332 forks source link

npm run watch fails #297

Closed JanikWeb closed 3 years ago

JanikWeb commented 3 years ago

Hi there, nice to see the further development of understrap-child - great work!

I'm working on a development server under CentOS Linux 7.9.2009 (Core)

I just downloaded and installed the understrap parent theme in WordPress. Then I downloaded the child-theme from github and installed it via "npm install". However when trying to run "npm run watch" I get the following error:

-bash-4.2$ npm run watch

> understrap-child@1.0.0 watch
> npm-run-all --parallel watch-run-*

/opt/plesk/node/12/lib/node_modules/npm/lib/cli.js:2
module.exports = async (process) => {
                       ^

SyntaxError: Unexpected token (
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:549:28)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
    at Module.require (module.js:504:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/opt/plesk/node/12/lib/node_modules/npm/bin/npm-cli.js:2:1)
/opt/plesk/node/12/lib/node_modules/npm/lib/cli.js:2
module.exports = async (process) => {
                       ^

SyntaxError: Unexpected token (
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:549:28)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
    at Module.require (module.js:504:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/opt/plesk/node/12/lib/node_modules/npm/bin/npm-cli.js:2:1)
ERROR: "watch-run-js" exited with 1.
howarddc commented 3 years ago

Thanks, we'll dig into this right away.

bacoords commented 3 years ago

Can you send us the results of running node -v in your terminal?

JanikWeb commented 3 years ago

sure:

-bash-4.2$ node -v
v6.17.1
0dp commented 3 years ago

sure:

-bash-4.2$ node -v
v6.17.1

You need to update node Current LTS version is 14!

JanikWeb commented 3 years ago

Thanks for pointing me in the right direction. Somehow the node command was mapped to the wrong version of node. I fixed it by installing nvm and updating node to the latest version using "nvm install node".