kit icon indicating copy to clipboard operation
kit copied to clipboard

My Install Failed. What Should I Do?

Open johnlindquist opened this issue 2 years ago • 2 comments

My Install Failed. What Should I Do?

There are a wide variety of reasons why the app may fail to install across all the platforms/configurations/machines. That's why I extracted the install process into a nifty npx tool. Just run this command and you should be able to launch the app once it's complete.

Make sure to quit the app before running this

npx @johnlindquist/install-kit@latest

🚨 If you run into an error with this, please post below and we'll get it sorted ASAP! 🚨

The app currently locks away the install process during startup (hence why I built the tool above). Once enough people verify the above tool works, I'll migrate it into the app.


More Details on the Install Process

The 3 Required Directories

1. ~/.kit

This is the Kit SDK. You should be able to download the SDK and extract it here. (This is also what npm run build tries to build)

https://github.com/johnlindquist/kitapp/releases/latest

Note - The SDK is just a built version of this repo with all the deps bundled to save on initial setup.

You should extract it so the package.json resides here: ~/.kit/package.json

2. ~/.kenv

This is the Kit Environent where scripts are stored. It's simply a way to organize scripts, logs, tmp, etc. You can clone it from: https://github.com/johnlindquist/kenv

You should clone it so the package.json resides here: ~/.kenv/package.json

3. ~/.knode

This is a version of node (v16.17.1) that matches the current version of the app.

https://nodejs.org/download/release/v16.17.1/

node should be accessible as ~/.knode/bin/node

Final Configuration Setups

Intall esbuild for TypeScript support

Use the .knode version of node to install esbuild into the ~/.kit dir:

cd ~/.kit && PATH=~/.knode/bin:$PATH npm i [email protected] --save-exact

Run the setup scripts

cd ~/.kit && ~/.knode/bin/node ~/.kit/run/terminal.js ~/.kit/setup/setup.js

Thoughts on the Setup Process

  • esbuild is a different binary per-platform. It's been a challenge to get the CI process bundling the correct version and fighting against code-signing of unsign binaries. I an not an expert in this area.
  • Keeping the ~/.kit and ~/.knode SDK outside of the app makes it possible to run scripts from the terminal and allows users to play with the SDK code before submitting PRs. It would be much easier to package it in the app, but we'd lose features.
  • In v2, I'm considering the implications of moving ~/.kit and ~/.knode to the app directory. But haven't come to any conclusions
  • There's a huge refactor in process that will clean up all the mess of setting up the dev environment. I hesitate to support the current way too much since it's a mess and it's going away soon.

johnlindquist avatar Jan 25 '23 17:01 johnlindquist

I ran this command earlier tonight. Everything worked fine - Then I encountered an issue starting kit. Which caused me to uninstall and wanting to run the npx command again. Now I get the following error on the NPX as well:

undefined:7 } ^

SyntaxError: Unexpected token } in JSON at position 111 at JSON.parse () at O.read (file:///C:/Users/DAOL/AppData/Local/npm-cache/_npx/3415c6bfffe36ec5/node_modules/@johnlindquist/kit-internal/dist/lowdb.js:1:3972) at async o.read (file:///C:/Users/DAOL/AppData/Local/npm-cache/_npx/3415c6bfffe36ec5/node_modules/@johnlindquist/kit-internal/dist/lowdb.js:1:477) at async db (file:///C:/Users/DAOL/AppData/Local/npm-cache/_npx/3415c6bfffe36ec5/node_modules/@johnlindquist/kit/core/db.js:33:5) at async file:///C:/Users/DAOL/AppData/Local/npm-cache/_npx/3415c6bfffe36ec5/node_modules/@johnlindquist/kit/share/auth-scriptkit.js:8:16

xenoxsis avatar Jan 25 '23 20:01 xenoxsis

I got an error in a weird background window when I start my laptop. Trying to run this install gives me the same error:

C:\Users\Me>npx @johnlindquist/install-kit@latest
Need to install the following packages:
  @johnlindquist/[email protected]
Ok to proceed? (y) y
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
undefined:1



SyntaxError: Unexpected token '', ""... is not valid JSON
    at JSON.parse (<anonymous>)
    at C.read (file:///C:/Users/Me/AppData/Local/npm-cache/_npx/3415c6bfffe36ec5/node_modules/@johnlindquist/kit-internal/dist/lowdb.js:1:4126)
    at async s.read (file:///C:/Users/Me/AppData/Local/npm-cache/_npx/3415c6bfffe36ec5/node_modules/@johnlindquist/kit-internal/dist/lowdb.js:1:590)
    at async db (file:///C:/Users/Me/AppData/Local/npm-cache/_npx/3415c6bfffe36ec5/node_modules/@johnlindquist/kit/core/db.js:43:5)
    at async file:///C:/Users/Me/AppData/Local/npm-cache/_npx/3415c6bfffe36ec5/node_modules/@johnlindquist/kit/share/auth-scriptkit.js:8:16

Node.js v20.1.0
npm notice
npm notice New patch version of npm available! 9.6.4 -> 9.6.7
npm notice Changelog: https://github.com/npm/cli/releases/tag/v9.6.7
npm notice Run npm install -g [email protected] to update!
npm notice

IanGrainger avatar Jun 04 '23 14:06 IanGrainger