johnlindquist / kit

Script Kit. Automate Anything.
https://scriptkit.com
MIT License
3.92k stars 138 forks source link

My Install Failed. What Should I Do? #1056

Open johnlindquist opened 1 year ago

johnlindquist commented 1 year ago

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 esbuild@0.16.15 --save-exact

Run the setup scripts

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

Thoughts on the Setup Process

xenoxsis commented 1 year ago

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

IanGrainger commented 1 year ago

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/install-kit@1.2.12
Ok to proceed? (y) y
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated uuid@3.4.0: 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 request@2.88.2: 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 npm@9.6.7 to update!
npm notice