Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jovo v4 "new" failed #269

Open
3 tasks
kubycsolutions opened this issue Nov 26, 2021 · 10 comments
Open
3 tasks

jovo v4 "new" failed #269

kubycsolutions opened this issue Nov 26, 2021 · 10 comments
Labels
v4 Issues/PRs for v4 of the Jovo CLI

Comments

@kubycsolutions
Copy link

kubycsolutions commented Nov 26, 2021

I'm submitting a...

  • [X ] Bug report
  • Feature request
  • Documentation issue or request
  • Other... Please describe:

Expected Behavior

Installed the Jovo v4 CLI (and installed the "jovo3" CLI so I still had access to the older implemention), made sure there wasn't a v4-* project directory, then tried to create one using jovo new to begin porting my code over from v3. Expected, of course, to have that new working directory created and populated without errors.

Current Behavior

jovo new failed with npm ERR code ERESOLVE

Error log

C:\Users\keshlam\jovo>jovo new v4-new-sounds-on-demand
                                                                               
jovo new: Create a new Jovo project
  >> Learn more: https://jovo.tech/docs/cli/new
                                                                               
 Welcome to the Jovo CLI Wizard
                                                                               
√ Pick a preset: » Or manually select features...
√ Choose the platforms you want to use (select with space): » Jovo Core Platform, Amazon Alexa, Google Assistant
√ Type the locales you want to use (comma-separated): ... en
√ Choose the programming language you want to use: » JavaScript
√ Do you want to save this preset to .jovo/config? » No
                                                                               
 Setting everything up
                                                                               
✓ Creating new directory v4-new-sounds-on-demand/
  C:\Users\keshlam\jovo\v4-new-sounds-on-demand
✓ Downloading and extracting template
✓ Generating package.json
✖ Installing npm dependencies
                                                                               
x Error: --------------------------------------------------------------------------------
›                                                                              
› Message:
›  Command failed: npm install
›  npm WARN old lockfile
›  npm WARN old lockfile The package-lock.json file was created with an old version of npm,
›  npm WARN old lockfile so supplemental metadata must be fetched from the registry.
›  npm WARN old lockfile
›  npm WARN old lockfile This is a one-time fix-up, please be patient...
›  npm WARN old lockfile
›  npm ERR! code ERESOLVE
›  npm ERR! ERESOLVE could not resolve
›  npm ERR!
›  npm ERR! While resolving: jovo-v4-template-js@undefined
›  npm ERR! Found: @jovotech/[email protected]
›  npm ERR! node_modules/@jovotech/db-filedb
›  npm ERR!   @jovotech/db-filedb@"^4.0.0" from the root project
›  npm ERR!
›  npm ERR! Could not resolve dependency:
›  npm ERR! @jovotech/db-filedb@"^4.0.0" from the root project
›  npm ERR!
›  npm ERR! Conflicting peer dependency: @jovotech/[email protected]
›  npm ERR! node_modules/@jovotech/framework
›  npm ERR!   peer @jovotech/framework@"4.0.0" from @jovotech/[email protected]
›  npm ERR!   node_modules/@jovotech/db-filedb
›  npm ERR!     @jovotech/db-filedb@"^4.0.0" from the root project
›  npm ERR!
›  npm ERR! Fix the upstream dependency conflict, or retry
›  npm ERR! this command with --force, or --legacy-peer-deps
›  npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
›  npm ERR!
›  npm ERR! See C:\Users\keshlam\AppData\Local\npm-cache\eresolve-report.txt for a full report.
›
›  npm ERR! A complete log of this run can be found in:
›  npm ERR!     C:\Users\keshlam\AppData\Local\npm-cache\_logs\2021-11-26T21_20_50_569Z-debug.log
›
›                                                                              
› Module:
›  NewCommand
›                                                                              
›                                                                              
› If you think this is not on you, you can submit an issue here: https://github.com/jovotech/jovo-cli/issues.
                                                                               

C:\Users\keshlam\jovo>

Your Environment

@jovotech/cli: 4.0.1

Environment:
System:
OS: Windows 10 10.0.19043
Binaries:
Node: 12.20.2 - C:\Program Files\nodejs\node.EXE
npm: 7.21.1 - C:\Program Files\nodejs\npm.CMD

@kubycsolutions
Copy link
Author

kubycsolutions commented Nov 26, 2021

Tried it again with the default (javascript) preset.
That succeeded.

Wiped it again and retried with the manually selected settings.
Same ERESOLVE complaint

So it's something about the difference between default and manual config.

@rubenaeg
Copy link
Contributor

I think it's because we accidently pushed a package-lock.json to the template. I already removed it, could you try again?

@rubenaeg
Copy link
Contributor

Btw the default preset uses TypeScript, that's why that didn't fail.

@kubycsolutions
Copy link
Author

kubycsolutions commented Nov 29, 2021

Uhm... I'm confused. If default now uses TypeScript, which appears to be true, what's the difference between that and the Default TS template? That looks like you intended to continue to offer both, and the docs still say both are supported... but you're right, both are creating src/*.ts rather than .js. Should Jovo now offer default and JS-default, or if not should both options still exist? (I'd argue that you should still support both, and at most suggest that JavaScript support is deprecated.)

Your fix did resolve my new-with-interactive-parameters glitch, with one quibble:

I accepted the default en as the locale... and Jovo or Alexa complained, correctly, that Locale en is not supported by Alexa. Please provide an alternative locale .... Probably better to have the default value be a legitimate locale such as en-US; maybe even better to have that be a selection, or a pair of sequential selections for language and then location so the former can filter the latter. (Also, the "Please provide an alternative locale" dialog is multiple-select checkboxes; this should probably be single-select.)

@rubenaeg
Copy link
Contributor

Ah, seems like you're using a beta config file, which used DefaultTs at one point, which got renamed to default, but seems like we didn't remove the old template. However, you can do that manually by editing .jovo/config in your home directory.

JavaScript support is not deprecated, you can simply choose JavaScript in the Jovo Wizard when running jovo new.

Regarding en, every platform we support thus far support other locales and languages respectively. If you select Alexa and en, it won't work, since Alexa doesn't support en. However, if you choose to use GoogleAssistant, you need en, as locales require a language there. So there isn't really a "legitimate" locale, however we could try to filter selectable locales by the platforms you selected earlier. However, when choosing mutliple platforms, this problem will still arise then, so I don't know if it's worth the hassle.

@kubycsolutions
Copy link
Author

Ah. Beta config would make sense; thanks for pointing me to the patch point.

Locales: If there are really conflicts between platforms, the ideal answer might be to ask language and country codes, then derive the platform-specific locale name as part of the deploy process for that platform -- or at least have a routine in deploy which makes a best guess for each based on what the user entered. Hiding this sort of detail is Jovo's mission, right?

@rubenaeg
Copy link
Contributor

We had that implemented in v3 for Google Assistant, but found that it would be cleaner/more transparent if the user explicitly specified the locales they want to build. Additionally, this allows the user to serve multiple locales while maintaining model, e.g. models/en.json will be built to en-US, en-CA and so on.

@kubycsolutions
Copy link
Author

kubycsolutions commented Nov 30, 2021 via email

@rubenaeg
Copy link
Contributor

rubenaeg commented Dec 1, 2021

The approach we're taking here allows you to specifiy the locales you want to use with each platform in relation to the language models you want to maintain. We made sure that this works with code completion as well, so if you want to map your language model to another locale, your IDE should show you a list of all supported locales for that platform (e.g. en is not present in that list for Alexa, but for Google Assistant). This seems to be the cleanest approach so far, because you as the developer are in control of what happens with your language model. If you want to support Alexa and Google Assistant for example, but you want to only maintain one language model en.json, your config would look something like this:

const project = new ProjectConfig({
  // ...
  new AlexaCli({ locales: { en: ['en-US'] } }),
  new GoogleAssistantCli()
});

Or, if your language model is en-US.json:

const project = new ProjectConfig({
  // ...
  new AlexaCli(),
  new GoogleAssistantCli({ locales: { 'en-US': ['en'] } })
});

You control how Jovo handles your language model, because we cannot assume which locales you want your platform to use (which could be very ambiguous).

@kubycsolutions
Copy link
Author

kubycsolutions commented Dec 1, 2021 via email

@jankoenig jankoenig added the v4 Issues/PRs for v4 of the Jovo CLI label Feb 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v4 Issues/PRs for v4 of the Jovo CLI
Projects
None yet
Development

No branches or pull requests

3 participants