slate icon indicating copy to clipboard operation
slate copied to clipboard

Slate Commands no longer running after node upgrade

Open patrickbjohnson opened this issue 6 years ago ā€¢ 9 comments

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 avatar Nov 01 '18 02:11 patrickbjohnson

@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 :(

patrickbjohnson avatar Nov 01 '18 17:11 patrickbjohnson

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

huguestennier avatar Nov 01 '18 20:11 huguestennier

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 [email protected] 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.

patrickbjohnson avatar Nov 01 '18 20:11 patrickbjohnson

Should work no problem with Node v8.11.1

huguestennier avatar Nov 01 '18 23:11 huguestennier

@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!

patrickbjohnson avatar Nov 02 '18 00:11 patrickbjohnson

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

IngoVals avatar Nov 02 '18 15:11 IngoVals

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)
  1. Now cd using that path to the slate directory. In this case:
cd /usr/local/lib/node_modules/@shopify/slate
  1. 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

jasonsemko avatar Nov 05 '18 21:11 jasonsemko

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

aphillips8 avatar Dec 03 '19 00:12 aphillips8

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

gcamacho079 avatar Feb 14 '20 20:02 gcamacho079