question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unexpected token error

See original GitHub issue

I apologize if this issue may have been fixed already but i cant seem to find a work around. im using visual studio on ubuntu 20.04 and I get this error when i run npm run build. i deleted everything and once again cloned the repo and tried npm run build without changing a single thing in the directory and i am still getting the issue. does anyone have a solution? below is the output from the terminal after running npm run build.

Thank you in advance!!!

michael@michael-HP-EliteDesk-705-G2-SFF:~/hashlips/hashlips_art_engine$ npm run build

hashlips_art_engine@1.1.1 build /home/michael/hashlips/hashlips_art_engine node index.js

/home/michael/hashlips/hashlips_art_engine/src/main.js:91 layerObj.options?.[“displayName”] != undefined ^

SyntaxError: Unexpected token . at Module._compile (internal/modules/cjs/loader.js:723:23) at Object.Module._extensions…js (internal/modules/cjs/loader.js:789:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3) at Module.require (internal/modules/cjs/loader.js:692:17) at require (internal/modules/cjs/helpers.js:25:18) at Object.<anonymous> (/home/michael/hashlips/hashlips_art_engine/index.js:2:39) at Module._compile (internal/modules/cjs/loader.js:778:30) at Object.Module._extensions…js (internal/modules/cjs/loader.js:789:10) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! hashlips_art_engine@1.1.1 build: node index.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the hashlips_art_engine@1.1.1 build 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! /home/michael/.npm/_logs/2022-01-22T17_40_14_683Z-debug.log michael@michael-HP-EliteDesk-705-G2-SFF:~/hashlips/hashlips_art_engine$

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:10

github_iconTop GitHub Comments

1reaction
macorificecommented, Jan 25, 2022

Same issue here (npm -v 8.3.2 - node -v 16.9.1) Solved following these steps:

rm -rf node_modules && rm package-lock.json

npm update

npm install

node index.js or npm run generate

0reactions
saviour07commented, Feb 8, 2022

I had this exact same issue, the winning combination for me on Windows 10 (20H2 19042.1415) was npm 8.4.1 and node 16.9.1

Read more comments on GitHub >

github_iconTop Results From Across the Web

SyntaxError: Unexpected token - JavaScript - MDN Web Docs
The JavaScript exceptions "unexpected token" occur when a specific language construct was expected, but something else was provided.
Read more >
JavaScript Error Handling: Unexpected Token - GeeksforGeeks
Not follow them throws an error.An unexpected token occurs if JavaScript code has a missing or extra character { like, ) + –...
Read more >
How to fix JavaScript unexpected token error
As you write your JavaScript application, the unexpected token error always occurs because JavaScript expected a specific syntax that's not ...
Read more >
How to fix: "SyntaxError: Unexpected token" in JavaScript
One common cause of the SyntaxError: Unexpected token error is a missing semicolon. In JavaScript, semicolons are used to indicate the end of...
Read more >
syntax error: unexpected token - javascript - Stack Overflow
The error SyntaxError: Unexpected token < likely means the API endpoint didn't return JSON in its document body, such as due to a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found