Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SyntaxError: Unexpected token < #13

Closed
Gaox2025f opened this issue May 15, 2023 · 1 comment
Closed

SyntaxError: Unexpected token < #13

Gaox2025f opened this issue May 15, 2023 · 1 comment

Comments

@Gaox2025f
Copy link

Gaox2025f commented May 15, 2023

Dear author, I got these following errors when I use this tool:

$ replace-jquery "src/controller/pages/**/*.js" "out.js"
Finding jQuery function reference in src/controller/pages/activate/activate.js ...
C:\Users\Administrator\AppData\Roaming\npm\node_modules\replace-jquery\node_modules\espree\lib\espree.js:190
const err = new SyntaxError(message);
^

SyntaxError: Unexpected token <
at Espree.raise (C:\Users\Administrator\AppData\Roaming\npm\node_modules\replace-jquery\node_modules\espree\lib\espree.js:190:25)
at Espree.unexpected (C:\Users\Administrator\AppData\Roaming\npm\node_modules\replace-jquery\node_modules\espree\lib\espree.js:235:18)
at pp$3.parseExprAtom (C:\Users\Administrator\AppData\Roaming\npm\node_modules\replace-jquery\node_modules\acorn\dist\acorn.js:2326:12)
at pp$3.parseExprSubscripts (C:\Users\Administrator\AppData\Roaming\npm\node_modules\replace-jquery\node_modules\acorn\dist\acorn.js:2129:21)
at pp$3.parseMaybeUnary (C:\Users\Administrator\AppData\Roaming\npm\node_modules\replace-jquery\node_modules\acorn\dist\acorn.js:2106:19)
at pp$3.parseExprOps (C:\Users\Administrator\AppData\Roaming\npm\node_modules\replace-jquery\node_modules\acorn\dist\acorn.js:2041:21)
at pp$3.parseMaybeConditional (C:\Users\Administrator\AppData\Roaming\npm\node_modules\replace-jquery\node_modules\acorn\dist\acorn.js:2024:21)
at pp$3.parseMaybeAssign (C:\Users\Administrator\AppData\Roaming\npm\node_modules\replace-jquery\node_modules\acorn\dist\acorn.js:1997:21)
at pp$1.parseVar (C:\Users\Administrator\AppData\Roaming\npm\node_modules\replace-jquery\node_modules\acorn\dist\acorn.js:1239:26)
at pp$1.parseVarStatement (C:\Users\Administrator\AppData\Roaming\npm\node_modules\replace-jquery\node_modules\acorn\dist\acorn.js:1101:10) {
index: 1021,
lineNumber: 46,
column: 23
}

Node.js v18.15.0

I am wondering what should I do? Downgrade Node.js version?

@Gaox2025f
Copy link
Author

Gaox2025f commented May 15, 2023

I downgraded Node.js to 14.0.0, it didn't work as well. Error messages are as follows:

$ replace-jquery "src/controller/pages/**/*.js" "out.js"
Finding jQuery function reference in src/controller/pages/activate/activate.js ...
(node:12428) UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token <
at Espree.raise (C:\Users\Administrator\AppData\Roaming\npm\node_modules\replace-jquery\node_modules\espree\lib\espree.js:190:25)
at Espree.unexpected (C:\Users\Administrator\AppData\Roaming\npm\node_modules\replace-jquery\node_modules\espree\lib\espree.js:235:18)
at Espree.pp$3.parseExprAtom (C:\Users\Administrator\AppData\Roaming\npm\node_modules\replace-jquery\node_modules\acorn\dist\acorn.js:2326:12)
at Espree.pp$3.parseExprSubscripts (C:\Users\Administrator\AppData\Roaming\npm\node_modules\replace-jquery\node_modules\acorn\dist\acorn.js:2129:21)
at Espree.pp$3.parseMaybeUnary (C:\Users\Administrator\AppData\Roaming\npm\node_modules\replace-jquery\node_modules\acorn\dist\acorn.js:2106:19)
at Espree.pp$3.parseExprOps (C:\Users\Administrator\AppData\Roaming\npm\node_modules\replace-jquery\node_modules\acorn\dist\acorn.js:2041:21)
at Espree.pp$3.parseMaybeConditional (C:\Users\Administrator\AppData\Roaming\npm\node_modules\replace-jquery\node_modules\acorn\dist\acorn.js:2024:21)
at Espree.pp$3.parseMaybeAssign (C:\Users\Administrator\AppData\Roaming\npm\node_modules\replace-jquery\node_modules\acorn\dist\acorn.js:1997:21)
at Espree.pp$1.parseVar (C:\Users\Administrator\AppData\Roaming\npm\node_modules\replace-jquery\node_modules\acorn\dist\acorn.js:1239:26)
at Espree.pp$1.parseVarStatement (C:\Users\Administrator\AppData\Roaming\npm\node_modules\replace-jquery\node_modules\acorn\dist\acorn.js:1101:10)
(Use node --trace-warnings ... to show where the warning was created)
(node:12428) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:12428) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants