alseambusher / crontab-ui

Easy and safe way to manage your crontab file
https://lifepluslinux.blogspot.com/2015/06/crontab-ui-easy-and-safe-way-to-manage.html
MIT License
2.84k stars 475 forks source link

SyntaxError: Unexpected token '?' #204

Closed svn-josh closed 1 year ago

svn-josh commented 2 years ago

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

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 commented 2 years ago

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$

alseambusher commented 2 years ago

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

alseambusher commented 2 years ago

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

stale[bot] commented 1 year ago

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.

aymen3009 commented 1 year ago

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

thap2331 commented 1 year ago

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

hd-vt commented 1 year ago

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.