node-themekit: Apple M1 build crashes when trying to build dependency of themekit
Was running into this issue trying to setup my dev environment on a new mac mini. Not sure if its something on my end or something that needs to be updated.
[6/15] ⠠ gifsicle
[9/15] ⠠ pngquant-bin
[7/15] ⠠ mozjpeg
[4/15] ⠠ @shopify/themekit
error /Users/andrewamistad/Sites/dry-farm-wines/node_modules/@shopify/themekit: Command failed.
Exit code: 1
Command: node ./lib/cli.js install
Arguments:
Directory: /Users/andrewamistad/Sites/dry-farm-wines/node_modules/@shopify/themekit
Output:
-/Users/andrewamistad/Sites/dry-farm-wines/node_modules/@shopify/themekit/lib/install.js:46
throw runErr;
^
Error: The `/Users/andrewamistad/Sites/dry-farm-wines/node_modules/@shopify/themekit/bin/theme` binary doesn't seem to work correctly
at BinWrapper.<anonymous> (/Users/andrewamistad/Sites/dry-farm-wines/node_modules/bin-wrapper/index.js:156:7)
at ChildProcess.<anonymous> (/Users/andrewamistad/Sites/dry-farm-wines/node_modules/bin-check/index.js:26:4)```
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 8
- Comments: 29 (4 by maintainers)
For anyone still not able to figure this out. Check out this solution. It worked for me and my local updates finally started to upload to shopify for me to test locally, the correct way. https://github.com/Shopify/slate/issues/1107
It also fixed an error from not showing
unknown command "[object Object]" for "theme"
========== STEPS I took ============
Updated
packages.json
file line"@shopify/themekit": "^0.6.12",
to be"@shopify/themekit": "^1.1.7",
and added aresolution
afterdependencies
."resolutions": { "**/@shopify/themekit": "^1.1.7" },
That way it would force yarn to use v1.1.9 of themekit instead of v0.6.12.Opened Terminal using the “Open using Rosetta” option.
Ran
yarn
and successfully compiledRan
yarn start
but got errorunknown command "[object Object]" for "theme"
and seemed to be coming from a the slate-sync/index.js line 4:const themekit = require('@shopify/themekit').command;
. I removed.command
and the error went away after runningyarn start
but would not upload to shopify to show my local version of the site.I updated the file
[theme path]/node_modules/@shopify/slate-sync/index.js
to reflect the changes found here: Slate #1107: comment thenyarn
complied correctly,yarn start
started correctly and uploaded to shopify.I keep on having that same issue,
unknown command "[object Object]" for "theme"
, the only difference being that im using@shopify/slate-tools@0.14.0
which doesn’t have aslate-sync
folder for me to apply the changes proposed here Slate #1107: comment.Does anybody know what to do in that case?
I’ve tried forking and manually upgrading
@shopify/themekit
tov1.1.6
and still seeing the same error. Anyone have any success with this yet?@kgea solution fixed it for me. I ended up including the modified slate-sync as a local npm package so any future installs wouldn’t overwrite the file fix. Also using yarn is important rather than npm to get the resolutions feature. See below for what my package.json looks like. To get a local version of slate-sync copy it from node_modules and include it in a folder in your theme. I typically don’t recommend doing that but since its very deprecated it should be ok.
@kgea
Confirming this solution works!! Thank you so much. 🙏 Using an Apple Macbook M1 w/ Big Sur v11.4
Any updates on this?
Edit: Manually updating the package.json of the project to modify the version of themekit seemed to work.
"@shopify/themekit": "1.1.7",
Yes unfortunately, it looks like the best option is for you to fork slate and update the tk version in the package.json
Gotcha. So as it stands no version of Slate can run on M1 chips due to the dependency on themekit 0.6.12 and its binaries.
I’m reaching the limits of my knowledge on these things - any potential suggestions for how to get Slate (which I appreciate is now obsolete, but with no official replacement) to use a version of tk >= 1.0.0?
Has anyone solved this problem yet? I receive the following error when I yarn install a project with themekit as a dependency:
~Please open this on the https://github.com/Shopify/node-themekit repo as it looks like an installation issue with the node library. We have seen success with others using themekit directly on M1~
I have learned that I can transfer issues now 😄