crontab-ui icon indicating copy to clipboard operation
crontab-ui copied to clipboard

SyntaxError: Unexpected token '?'

Open svn-josh opened this issue 2 years ago • 3 comments

Make sure these boxes are checked( - [x] ) before submitting an issue.

  • [ x] Running latest npm and node? (Run npm --version and node --version). Get the latest nodejs here.
  • [x ] The node_modules folder has right permissions (Run ls -ld $(npm root -g)/crontab-ui)
  • [x ] Read issues.md
  • [x ] Gone through existing open and closed issues.

finkfw@FF-Auto-Linux:~/Crontab-UI$ crontab-ui /usr/local/lib/node_modules/crontab-ui/crontab.js:27 var humanCronLocate = process.env.HUMANCRON ?? "en" ^ 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. (/usr/local/lib/node_modules/crontab-ui/app.js:4:15) at Module._compile (internal/modules/cjs/loader.js:999:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) finkfw@FF-Auto-Linux:~/Crontab-UI$

svn-josh avatar Aug 01 '22 13:08 svn-josh

finkfw@FF-Auto-Linux:~/Crontab-UI$ crontab-ui /usr/local/lib/node_modules/crontab-ui/crontab.js:27 var humanCronLocate = process.env.HUMANCRON ?? "en" ^

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. (/usr/local/lib/node_modules/crontab-ui/app.js:4:15) at Module._compile (internal/modules/cjs/loader.js:999:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) finkfw@FF-Auto-Linux:~/Crontab-UI$

svn-josh avatar Aug 01 '22 13:08 svn-josh

Which node version are you using? (Run npm --version and node --version)

alseambusher avatar Sep 01 '22 15:09 alseambusher

https://stackoverflow.com/questions/67959998/nullish-coalescing-assignment-operator-in-nodejs

alseambusher avatar Sep 01 '22 15:09 alseambusher

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 31 '22 16:10 stale[bot]

i had the same issue and it turns out that it was the node version that caused this. so basically my user uses node v 19 but all the scripts that are running by the corn use v12.22.9

aymen3009 avatar Jan 24 '23 14:01 aymen3009

Hey @aymen3009, I am not a node user. Could you share how did you make the user run v12.22.9?

I am getting the above error as well. My details: node --version is v12.22.9 npm --version is 8.5.1

thap2331 avatar Feb 09 '23 03:02 thap2331

i just did nano - c /usr/local/lib/node_modules/crontab-ui/crontab.js

on line 27: i removed ?? "en" and the file looks like this.

image`

and the ui is working for me.

hd-vt avatar Aug 24 '23 05:08 hd-vt