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

Error executing retype watch #250

Closed
juanppdev opened this issue Jan 12, 2022 · 13 comments
Closed

Error executing retype watch #250

juanppdev opened this issue Jan 12, 2022 · 13 comments

Comments

@juanppdev
Copy link

Good afternoon, I am running retype watch and I get the following error:

/usr/local/lib/node_modules/retypeapp/platforms/osx-x64/retype: 5: Syntax error: ")" unexpected
@fabriciomurta
Copy link
Contributor

Do you have any other information like Node JS version?

@juanppdev
Copy link
Author

I have nodejs version 16.13.1

@fabriciomurta
Copy link
Contributor

fabriciomurta commented Jan 12, 2022

I have just tested with Node 16.13.2 and it works on mac. The file it points "syntax error" is a binary/executable file, it seems for some reason you host is interpreting it as a script. Can you share more system specs and the exact steps you followed to install retype on your end?

The command md5 /usr/local/lib/node_modules/retypeapp/platforms/osx-x64/retype should return:

MD5 (/usr/local/lib/node_modules/retypeapp/platforms/osx-x64/retype) = 4d0d67afb0e43e324fabb9c633dacbf6

For Retype version 1.11.2.

Did it work in the past and stopped working at some point, or is this your initial installation?

@juanppdev
Copy link
Author

Screenshot_20220113-065716_Termux

@fabriciomurta
Copy link
Contributor

fabriciomurta commented Jan 13, 2022

Termux, I use that in my android phone... It doesn't seem you're using a mac, linux or windows system. Because your chroot jail informs to Node a macos system under x64 architecture, retype tries to run as if under that platform, but by what you provided I cannot tell where you are trying to run this from? By your screenshot screen ratio it really looks like a phone though.

@juanppdev juanppdev reopened this Jan 13, 2022
@juanppdev
Copy link
Author

In the terminal termux I am using: proot-distro login ubuntu

@juanppdev
Copy link
Author

I still haven't been able to use Retypeapp, and I still get that error

@fabriciomurta
Copy link
Contributor

What system, OS and architecture/processor you're trying to run retype from?

  • If that's a Mac, Linux or Windows, you can just install Node from nodejs.org and run in its native shell.
  • If elsewhere, you may be able to run NuGet version of retype via dotnet tool

What doesn't add up to me is that your system informs it is a mac x64, but it is not clear why do you use termux on a mac PC; besides your screenshot suggests you are running it from a phone. Retype is supported where .NET application is supported, that is: Linux, Windows and Mac OS.

Custom builds of .NET should allow Retype to run in other systems via its NuGet package. This means installing the dotnet tool on your command prompt and Retype is not tested in other systems, so we cannot tell what may be missing as some systems' support may not be fully implemented. Retype is based on .NET 5.x, installing .NET 6 may be okay, but we're keeping our Retype tests on .NET 5 until we migrate to .NET 6.

@fabriciomurta
Copy link
Contributor

fabriciomurta commented Jan 14, 2022

Looking a bit about proot-distro, it seems it uses QEMU to enable running software for other architecture on arm-based hosts and maybe others.

And it looks like it has trouble handling .NET runtime, according to dotnet/runtime#13648. Retype runs on top of .NET 5 runtime environment.

@AmreshSinha
Copy link

I am facing this issue too!
I have a arm64 architecture host on oracle cloud and I am running a arm version of debian bullseye docker image. Inside that image I am running my repo which uses retype as a documentation generator. But it throws this same error

Syntax error: ")" unexpected

Any help will be appreciated!
Thanks!

@fabriciomurta
Copy link
Contributor

Retype NPM package is not compatible with the arm64 architecture. It works on linux/debian as long as it is in an x64-64 arch. This is a limitation from our upstream requirement -- .NET 5.

If you can get .NET 5 or 6 installed on your Debian arm64 image (install the dotnet commandline available), then you should be able to run Retype with its NuGet package -- install with dotnet tool install --global retypeapp

Otherwise, switching to an AMD/Intel x86-64 architecture should allow you to install and run the NPM package.

@AmreshSinha
Copy link

AmreshSinha commented Feb 8, 2022

Thanks! I have made it work now on arm.
Here is the Dockerfile:

FROM ubuntu:18.04

RUN apt-get update -y
RUN apt-get install nodejs npm curl wget -y
RUN npm install -g n && n 16 && npm i --g npm@latest

# Installing Dotnet 5 arm64 and setting new PATH for dotnet cli to work
RUN mkdir /lib/dotnet-arm64 && tar zxf /tmp/dotnet-sdk-5.0.100-linux-arm64.tar.gz -C /lib/dotnet-arm64
ENV DOTNET_ROOT=/lib/dotnet-arm64
ENV PATH=/lib/dotnet-arm64:$PATH
ENV PATH=$PATH:/root/.dotnet/tools
RUN dotnet tool install --global retypeapp

RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY ./package.json /usr/src/app/
RUN npm install && npm cache clean --force
COPY ./ /usr/src/app
ENV NODE_ENV production
ENV PORT 80
EXPOSE 80

RUN retype build
CMD node app.js

See also

@fabriciomurta
Copy link
Contributor

Way to go! That's a pity that .NET 5 didn't make stock builds for such distros, it becomes hard to maintain if the upstream does not support the platform. Glad we have the NuGet package to aid.

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

3 participants