rajasegar/alacritty-themes

ERR_INVALID_ARG_TYPE on attempting to start

Closed this issue · 4 comments

Describe the bug

After fresh installing both npm and alacritty-themes, I get the following error when attempting to run the alacritty-themes command

PS C:\> alacritty-themes
node:internal/validators:119
    throw new ERR_INVALID_ARG_TYPE(name, 'string', value);
    ^

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
    at new NodeError (node:internal/errors:371:5)
    at validateString (node:internal/validators:119:11)
    at Object.join (node:path:429:7)
    at possibleLocations (C:\Users\[redacted]\AppData\Roaming\npm\node_modules\alacritty-themes\src\helpers\index.js:74:10)
    at Object.<anonymous> (C:\Users\[redacted]\AppData\Roaming\npm\node_modules\alacritty-themes\src\helpers\index.js:7:5)
    at Module._compile (node:internal/modules/cjs/loader:1095:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1147:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:999:19) {
  code: 'ERR_INVALID_ARG_TYPE'
}

Node.js v17.0.1

Steps to reproduce the behavior: simply attempt to run alacritty-themes

  1. Installation

I installed it via npm i -g alacritty-themes (global installation)

  1. Run alacritty-themes
  • [ x ] Did you add params? yes, I type "alacritty-themes Ayu-Dark"
  • [ x ] Did you add params? no, I just type "alacritty-themes" then click up/down keys

Neither works, same error.

Operative System:

Windows 10 Home 19043.1348

@leslaron thank you for opening the issue. would you please update your global package to the last version and try again.

I'd like to have your help to validate this package works on Windows I haven't had the chance to test it there.

@leslaron thank you for opening the issue. would you please update your global package to the last version and try again.

I'd like to have your help to validate this package works on Windows I haven't had the chance to test it there.

@JuanVqz So with the new update I get a different error which is as follows:


PS C:\> alacritty-themes
C:\Users\[redacted]\AppData\Roaming\npm\node_modules\alacritty-themes\index.js:18
    throw NoAlacrittyFileFoundError;
    ^

Error: No Alacritty configuration file found. Expected one of the following files to exist:
C:\Users\[redacted]\AppData\Roaming\alacritty\alacritty.yml
    at Object.<anonymous> (C:\Users\[redacted]\AppData\Roaming\npm\node_modules\alacritty-themes\src\helpers\index.js:5:35)
    at Module._compile (node:internal/modules/cjs/loader:1095:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1147:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:999:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (C:\Users\[redacted]\AppData\Roaming\npm\node_modules\alacritty-themes\bin\cli.js:8:26)
    at Module._compile (node:internal/modules/cjs/loader:1095:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1147:10)

The alacritty folder was not created upon a fresh install, however by manually creating both the folder and the yml file in appdata\roaming, the themes now seem to work just fine.

Yes, we don't create the alacritty.yml file unless you required typing the alacritty-themes --create command

I don't understand how windows manage the folders, where did you create the folder and alacritty.yml file?
appdata\roaming is after your personal path? I mean Users/my_user\appdata\roaming or what is the full path?

Could you give me a favor? would you test the alacritty-themes --create command, please?

Also, In good news it's working now!, you can close the issue if you feel it's solved, please

Yes, we don't create the alacritty.yml file unless you required typing the alacritty-themes --create command

I don't understand how windows manage the folders, where did you create the folder and alacritty.yml file? appdata\roaming is after your personal path? I mean Users/my_user\appdata\roaming or what is the full path?

Could you give me a favor? would you test the alacritty-themes --create command, please?

Also, In good news it's working now!, you can close the issue if you feel it's solved, please

PS C:\> npm uninstall -g alacritty-themes

removed 20 packages, and audited 1 package in 624ms

found 0 vulnerabilities
PS C:\> npm i -g alacritty-themes

added 20 packages, and audited 21 packages in 4s

1 package is looking for funding
  run `npm fund` for details

found 0 vulnerabilities
PS C:\> alacritty-themes --create
The alacritty.yml config file was created here C:\Users\my_username\AppData\Roaming\alacritty\alacritty.yml
PS C:\> alacritty-themes
√ Select a theme » Baskerville - Count Von Count
The theme "Count Von Count" has been applied successfully!
PS C:\>

@JuanVqz I missed the --create command, and that solved it entirely. Can that not be run on install? Anyways, issue resolved. As for the install location, I hope the above can help with that.