Closed faassen closed 3 years ago
Thanks. I can reproduce the error with the following command:
npx presetter use presetter-preset-essentials
With node 16.10
npm 7.24
presetter use <preset..>
adopt the specified preset to the project
Positionals:
preset proceed only if the specified file exists
[array] [required] [default: []]
Options:
--version Show version number [boolean]
--help Show help [boolean]
TypeError: Cannot read properties of undefined (reading '0')
With node 14.18
npm 6.14.5
npx: installed 308 in 21.508s
presetter use <preset..>
adopt the specified preset to the project
Positionals:
preset proceed only if the specified file exists
[array] [required] [default: []]
Options:
--version Show version number [boolean]
--help Show help [boolean]
Error: Missing preset defined in .presetterrc
There is a slight difference between the 2 npm versions.
As a side note, presetter
does recognise the config file with or without the .json
extension. So both .presetterrc
and .presetterrc.json
works.
@faassen The issue is now fixed with 3.0.1. both node 14 & 16 environments should work! Check it out. 😉
Here are some user reports as I think there are a few bugs that crept into v3. No rush, just playing with it.
I tried:
in an empty directory. This failed because
No big deal but it might help to add a note in the README that you first need to initialize the package.
Then I tried
But this crashes for me too:
This seems to be a bug?
(Incidentally the error message is
Error: Missing preset defined in .presetterrc
but.presetterrc.json
is the file I find insidepresetter
; maybe both work?)Not being entirely sure, I also tried:
(which one is it? The docs mention you can use
preset-essentials
but the package listing has thepresetter-
prefix)And
But give me the same error. So it looks like a correct
.presetterrc
is required.So then I added:
And did (weirdly enough, okay):
But that doesn't work either as I get this:
So it is
presetter-preset-essentials
then, unlike what the README at first suggested. This does work:Unfortunately all my symlinks are broken. For some reason it's pointing to:
And while
../../.npm/_npx
exists,20288
does not.Trying it again with a new package, this time with a
.presetterrc.json
like this:Nope, I still end up with broken symlinks.
Node version: v14.17.6 NPM version: 6.14.15