SyntaxError: Unexpected token .
minhtaile2712 opened this issue · comments
I'm running docker-compose build
on branch main
and have this issue.
I'm new to this project so I cannot figure out how to fix it my self. Please help.
=> ERROR [eshop/webspa:linux-latest node-build 6/6] RUN npm i npm@latest -g && npm update && npm install && npm 6.7s
------
> [eshop/webspa:linux-latest node-build 6/6] RUN npm i npm@latest -g && npm update && npm install && npm run build:prod:
#0 5.974 /usr/local/bin/npx -> /usr/local/lib/node_modules/npm/bin/npx-cli.js
#0 5.974 /usr/local/bin/npm -> /usr/local/lib/node_modules/npm/bin/npm-cli.js
#0 6.008 + npm@9.4.2
#0 6.008 added 108 packages from 34 contributors, removed 262 packages and updated 125 packages in 5.418s
#0 6.066 ERROR: npm v9.4.2 is known not to run on Node.js v10.13.0. You'll need to upgrade
#0 6.066 to a newer Node.js version in order to use this version of npm. This version of
#0 6.066 npm supports the following node versions: `^14.17.0 || ^16.13.0 || >=18.0.0`. You
#0 6.066 can find the latest version at https://nodejs.org/.
#0 6.066
#0 6.066 ERROR:
#0 6.067 /usr/local/lib/node_modules/npm/lib/utils/exit-handler.js:21
#0 6.067 const hasLoadedNpm = npm?.config.loaded
#0 6.067 ^
#0 6.067
#0 6.067 SyntaxError: Unexpected token .
#0 6.067 at new Script (vm.js:79:7)
#0 6.067 at createScript (vm.js:251:10)
#0 6.067 at Object.runInThisContext (vm.js:303:10)
#0 6.067 at Module._compile (internal/modules/cjs/loader.js:656:28)
#0 6.067 at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
#0 6.067 at Module.load (internal/modules/cjs/loader.js:598:32)
#0 6.067 at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
#0 6.067 at Function.Module._load (internal/modules/cjs/loader.js:529:3)
#0 6.067 at Module.require (internal/modules/cjs/loader.js:636:17)
#0 6.067 at require (internal/modules/cjs/helpers.js:20:18)
------
failed to solve: executor failed running [/bin/sh -c npm i npm@latest -g && npm update && npm install && npm run build:prod]: exit code: 1
My environment is: Windows 10 with wsl2 enabled, Docker version 20.10.21, NodeJs v18.14.0, npm 9.3.1.
Hi @minhtaile2712, thanks for sharing your query. You are using the wrong branch, working branch is dev
, or you can follow eShopOnContainers - BRANCH GUIDE for more information. It should work for you.
Hi @minhtaile2712, are you able to resolve your issue with the dev
branch?
At first I used dev
branch (the default brand when I cloned this project), then I faced some serious errors that I thought it might take long to fix. Then I switched to main
branch hoping it would be more stable. I will comment more about that "serious error" later today.
Hi @minhtaile2712, waiting for your response.
Okay, so this is how I faced the issue from the very beginning.
I cloned this project. It's was on dev
branch. Then I followed the steps on wiki/Windows-setup
.
After 21/21 (all) containers started. I went to http://host.docker.internal:5100/
as instructed.
I clicked Login
, then clicked Cancel
. The screen then was:
An unhandled exception occurred while processing the request.
OpenIdConnectProtocolException: Message contains error: 'access_denied', error_description: 'error_description is null', error_uri: 'error_uri is null'.
Unknown location
Exception: An error was encountered while handling the remote login.
Microsoft.AspNetCore.Authentication.RemoteAuthenticationHandler.HandleRequestAsync()
It was a standard error screen of dotnet application.
The error would not show on SPA version of the app.
Hi @minhtaile2712, consider the dev
branch. Could you please clean up the old docker images and build the docker images again? - To build and run the app
- Go to the
/src/
directory and first-time build without cache
docker-compose build --no-cache
- then, run
docker-compose up sqldata
- Once it's ready to accept the new connection, then you can bring up the other container by using the following command from a separate terminal window.
docker-compose up
Let us know if this works for you.
HI @minhtaile2712, I am closing this issue for now. However, feel free to continue the conversation and reopen it if you are looking of more help.