Shopify / slate

Slate is a toolkit for developing Shopify themes. It's designed to assist your workflow and speed up the process of developing, testing, and deploying themes.
https://shopify.github.io/slate
MIT License
1.28k stars 365 forks source link

Slate Commands no longer running after node upgrade #861

Open patrickbjohnson opened 6 years ago

patrickbjohnson commented 6 years ago

Problem

Pulled down existing site from Shopify. Migrated theme to Slate build.

Was using slate watch to run dev instance of theme.

Updated node to latest v11.0.0 and now slate commands fail.

slate watch
fs.js:25
'use strict';
^

ReferenceError: internalBinding is not defined
    at fs.js:25:1
    at req_ (/usr/local/lib/node_modules/@shopify/slate/node_modules/natives/index.js:137:5)
    at Object.req [as require] (/usr/local/lib/node_modules/@shopify/slate/node_modules/natives/index.js:54:10)
    at Object.<anonymous> (/usr/local/lib/node_modules/@shopify/slate/node_modules/graceful-fs/fs.js:1:99)
    at Module._compile (internal/modules/cjs/loader.js:707:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:718:10)
    at Module.load (internal/modules/cjs/loader.js:605:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:544:12)
    at Function.Module._load (internal/modules/cjs/loader.js:536:3)
    at Module.require (internal/modules/cjs/loader.js:643:17)

I've tried re-installed. I've tried using yarn or npm commands to install modules again but nothing seems to work.

Currently running 0.13.0 of slate-tools

Additionally, I have a Slate v0 theme (non-migrated) which suffers from the same issue.

patrickbjohnson commented 6 years ago

@t-kelly not sure if the tags were automated but have y'all not see this issue before? Was looking here and ThemeKit's repo to try and find a resolution to the issue. Handful of paying clients awaiting those changes to go live :(

huguestennier commented 6 years ago

Any particular reason you absolutely need the latest node? If it's urgent I would suggest downgrading Node

patrickbjohnson commented 6 years ago

I believe I had to update for a separate project. Which in hindsight is exactly what something like NVM is for.

How we Iā€™m not entirely sure which version of node would resolve this issue.

--Sent from Jean-Ralphio the iPhone

On Nov 1, 2018, at 4:07 PM, Hugues Tennier notifications@github.com wrote:

Any particular reason you absolutely need the latest node? If it's urgent I would suggest downgrading Node

ā€” You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

huguestennier commented 6 years ago

Should work no problem with Node v8.11.1

patrickbjohnson commented 6 years ago

@huguestennier Adding nvm and rolling back to v8.11.1 has resolved my issue but still persists with latest version of node.

Thank you for your help!

IngoVals commented 6 years ago

This is a bug in the natives dependency and needs to be updated to at least 1.1.1 I believe.

https://github.com/isaacs/natives/issues/14

jasonsemko commented 6 years ago

Solution (for me)

This bug comes from "unzip2": "0.2.5", which as @IngoVals correctly states above uses a now outdated version of natives.

How I fixed this issue:

  1. Find the path natives is in. You can easily do this by looking at your error message. I'm on a mac so it's at the same place as @patrickbjohnson :
    at req_ (/usr/local/lib/node_modules/@shopify/slate/node_modules/natives/index.js:137:5)
  2. Now cd using that path to the slate directory. In this case:
    cd /usr/local/lib/node_modules/@shopify/slate
  3. All we need to do is update natives. I went ahead and uninstalled too:
    npm uninstall natives
    npm install natives 

That gave me the latest natives version and now slate works

aphillips8 commented 4 years ago

For me the fix was downgrading Node to 8.11.1 using nvm. I messed around with natives but that didn't work for me.

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.1/install.sh | bash
nvm install 8.11.1
nvm use 8.11.1
gcamacho079 commented 4 years ago

Using nvm to switch to 8.11.1 for Slate v0 development also worked for me. šŸ‘ Thanks all.