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

Doesn't install correctly on Linux-based operating systems #94

Open
MykalMachon opened this issue Jun 16, 2021 · 4 comments
Open

Doesn't install correctly on Linux-based operating systems #94

MykalMachon opened this issue Jun 16, 2021 · 4 comments
Labels

Comments

@MykalMachon
Copy link

Problem

On Linux-based operating systems, @shopify/themekit fails to install correctly. This is because Themekit itself is not installed during the npm install process.

I have a workaround (see More Information below), but ideally, we could automate this by detecting the operating system version, and running the Linux Themekit installation command during the npm install process

Tested and confirmed the issue on WSL 2 Ubuntu, Ubuntu 20.04 LTS, and Pop_OS!

Replication steps

  1. Install @shopify/themekit as part of a repo or globally
  2. Attempt to use Themekit in any way (CLI or Node.js scripts)
  3. Notice the following error log
    screenshot_of_error

More Information

I have a temporary workaround which involves the following after running npm install in the repo:

  1. Install Shopify themekit conventionally using Shopify's Themekit Linux guide here
  2. verify that Themekit is installed by typing theme in your terminal
  3. note the location of Themekit by running whereis theme in your terminal
  4. navigate to ./node_modules/@shopify/themekit and create a folder called bin, in that folder create a symbolic link to Themekit's installation location (which we noted in step three) ln -s {{ result of step 3 here}}
  5. Rerun your Themekit commands, they should work now
@erickzhao erickzhao added the bug label Jun 16, 2021
@erickzhao
Copy link
Collaborator

I don't have a Linux machine on hand, but is there any reason the post-install script would fail to download the binary for Linux systems?

The binary downloading logic exists for Linux 32-bit and 64-bit:

const installer = new BinWrapper()
.src(`${urlAndPath}/darwin-amd64/theme`, 'darwin')
.src(`${urlAndPath}/linux-386/theme`, 'linux')
.src(`${urlAndPath}/linux-amd64/theme`, 'linux', 'x64')
.src(`${urlAndPath}/windows-386/theme.exe`, 'win32')
.src(`${urlAndPath}/windows-amd64/theme.exe`, 'win32', 'x64')
.dest(config.destination)
.use(config.binName);

and the binaries themselves seem to exist as well on S3: https://shopify-themekit.s3.amazonaws.com/v1.2.0/linux-amd64/theme

@MykalMachon
Copy link
Author

@erickzhao , I actually noticed this right after submitting the issue- I just wanted to get this in before I went to bed last night so didn't take much time to source dive beforehand.

I'm at work right now, but will run npm install on one of my affected repos and look for errors during postinstall / install later tonight and report back.

@MykalMachon
Copy link
Author

MykalMachon commented Jun 17, 2021

@erickzhao just confirmed that there are no errors logged when installing the package.
image

Additionally, now that I know to look, you can tell that nothing is being run on post-install (on windows you watch a progress bar as Themekit is installed)

Is there anything I can do (as someone with access to a Linux machine) to help solve this?

@erickzhao
Copy link
Collaborator

I believe you can use npm link to symlink a local install of @shopify/node-themekit to a test repo and try to log what is happening in that post-install script.

I can take a look at this whenever I get around to installing a Linux VM on my Macbook, as well. :)

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

No branches or pull requests

2 participants