quarkiverse / quarkus-quinoa

Quinoa is a Quarkus extension which eases the development, the build and serving of single page apps (built with NodeJS: React, Angular, …) alongside Quarkus . It is possible to use it with a Quarkus backend in a single project
Apache License 2.0
83 stars 41 forks source link

Node Version Manager: interferes with Quinoa #775

Open DaiYuANg opened 1 month ago

DaiYuANg commented 1 month ago

Describe the bug

Here is fedora and nvm environment. Also setting nvm environment for bash. In my terminal using bash or sh pnpm is found but when start in ide there is log

024-09-24 01:37:21,728 INFO  [io.qua.qui.dep.fra.FrameworkType] (build-38) Quinoa detected 'VITE' frameworkType from package.json file.
2024-09-24 01:37:21,965 INFO  [io.qua.qui.dep.QuinoaProcessor] (build-17) Fresh Quinoa build, let's install packages...
2024-09-24 01:37:21,968 INFO  [io.qua.qui.dep.pac.PackageManagerRunner] (build-17) Running Quinoa package manager install command: pnpm install
2024-09-24 01:37:21,971 INFO  [io.qua.qui.dep.pac.PackageManagerRunner] (build-17) sh: line 1: pnpm: command not found
 Failed to start quarkus: java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
    [error]: Build step io.quarkiverse.quinoa.deployment.QuinoaProcessor#install threw an exception: java.lang.RuntimeException: Error in Quinoa while running package manager install command: pnpm install
    at io.quarkiverse.quinoa.deployment.packagemanager.PackageManagerRunner.install(PackageManagerRunner.java:86)
    at io.quarkiverse.quinoa.deployment.QuinoaProcessor.install(QuinoaProcessor.java:145)
    at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:733)
    at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:856)
    at io.quarkus.builder.BuildContext.run(BuildContext.java:256)
    at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
    at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2516)
    at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2495)
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1521)
    at java.base/java.lang.Thread.run(Thread.java:1583)
    at org.jboss.threads.JBossThread.run(JBossThread.java:483)

    at io.quarkus.runner.bootstrap.AugmentActionImpl.runAugment(AugmentActionImpl.java:354)
    at io.quarkus.runner.bootstrap.AugmentActionImpl.createInitialRuntimeApplication(AugmentActionImpl.java:272)
    at io.quarkus.runner.bootstrap.AugmentActionImpl.createInitialRuntimeApplication(AugmentActionImpl.java:62)
    at io.quarkus.deployment.dev.IsolatedDevModeMain.firstStart(IsolatedDevModeMain.java:91)
    at io.quarkus.deployment.dev.IsolatedDevModeMain.accept(IsolatedDevModeMain.java:430)
    at io.quarkus.deployment.dev.IsolatedDevModeMain.accept(IsolatedDevModeMain.java:57)
    at io.quarkus.bootstrap.app.CuratedApplication.runInCl(CuratedApplication.java:138)
    at io.quarkus.bootstrap.app.CuratedApplication.runInAugmentClassLoader(CuratedApplication.java:93)
    at io.quarkus.deployment.dev.DevModeMain.start(DevModeMain.java:131)
    at io.quarkus.deployment.dev.DevModeMain.main(DevModeMain.java:62)
Caused by: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
    [error]: Build step io.quarkiverse.quinoa.deployment.QuinoaProcessor#install threw an exception: java.lang.RuntimeException: Error in Quinoa while running package manager install command: pnpm install
    at io.quarkiverse.quinoa.deployment.packagemanager.PackageManagerRunner.install(PackageManagerRunner.java:86)
    at io.quarkiverse.quinoa.deployment.QuinoaProcessor.install(QuinoaProcessor.java:145)
    at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:733)
    at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:856)
    at io.quarkus.builder.BuildContext.run(BuildContext.java:256)
    at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
    at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2516)
    at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2495)
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1521)
    at java.base/java.lang.Thread.run(Thread.java:1583)
    at org.jboss.threads.JBossThread.run(JBossThread.java:483)

    at io.quarkus.builder.Execution.run(Execution.java:123)
    at io.quarkus.builder.BuildExecutionBuilder.execute(BuildExecutionBuilder.java:79)
    at io.quarkus.deployment.QuarkusAugmentor.run(QuarkusAugmentor.java:161)
    at io.quarkus.runner.bootstrap.AugmentActionImpl.runAugment(AugmentActionImpl.java:350)
    ... 9 more
Caused by: java.lang.RuntimeException: Error in Quinoa while running package manager install command: pnpm install
    at io.quarkiverse.quinoa.deployment.packagemanager.PackageManagerRunner.install(PackageManagerRunner.java:86)
    at io.quarkiverse.quinoa.deployment.QuinoaProcessor.install(QuinoaProcessor.java:145)
    at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:733)
    at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:856)
    at io.quarkus.builder.BuildContext.run(BuildContext.java:256)
    at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
    at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2516)
    at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2495)
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1521)
    at java.base/java.lang.Thread.run(Thread.java:1583)
    at org.jboss.threads.JBossThread.run(JBossThread.java:483)

Quinoa version

2.4.8

Quarkus version

3.14.4

Build / Runtime

Vite

Package Manager

PNPM

Steps to reproduce the behavior

just setup nvm and new quarkus project with quinoa

Expected behavior

Quarkus startup normally

melloware commented 1 month ago

can you post your package.json here so I can see it?

melloware commented 1 month ago

also do you have?

quarkus.quinoa.package-manager-install.pnpm-version=7.12.0

in your application.properties?

DaiYuANg commented 1 month ago

can you post your package.json here so I can see it?

{
  "name": "webui",
  "private": true,
  "version": "0.0.0",
  "type": "module",
  "scripts": {
    "dev": "vite",
    "build": "tsc -b && vite build",
    "lint": "eslint .",
    "preview": "vite preview"
  },
  "dependencies": {
    "react": "^18.3.1",
    "react-dom": "^18.3.1"
  },
  "devDependencies": {
    "@eslint/js": "^9.9.0",
    "@types/react": "^18.3.3",
    "@types/react-dom": "^18.3.0",
    "@vitejs/plugin-react-swc": "^3.5.0",
    "eslint": "^9.9.0",
    "eslint-plugin-react-hooks": "^5.1.0-rc.0",
    "eslint-plugin-react-refresh": "^0.4.9",
    "globals": "^15.9.0",
    "typescript": "^5.5.3",
    "typescript-eslint": "^8.0.1",
    "vite": "^5.4.1"
  },
  "packageManager": "pnpm@9.11.0"
}

Just a new vite project

DaiYuANg commented 1 month ago

also do you have?

quarkus.quinoa.package-manager-install.pnpm-version=7.12.0

in your application.properties?

I set this on package.json

melloware commented 1 month ago

Quinoa doesn't read the package JSON for the version it reads the application.properties quarkus.quinoa.package-manager-install.pnpm-version=9.11.0 can you try that

DaiYuANg commented 1 month ago

Quinoa doesn't read the package JSON for the version it reads the application.properties quarkus.quinoa.package-manager-install.pnpm-version=9.11.0 can you try that

quarkus:
  log:
    console:
      json: false
  datasource:
    jdbc: false
    devservices:
      enabled: true
  quinoa:
    package-manager-install:
      pnpm-version: 9.11.0

That does not work still log

sh: line 1: pnpm: command not found
DaiYuANg commented 1 month ago

Quinoa doesn't read the package JSON for the version it reads the application.properties quarkus.quinoa.package-manager-install.pnpm-version=9.11.0 can you try that

quarkus:
  log:
    console:
      json: false
  datasource:
    jdbc: false
    devservices:
      enabled: true
  quinoa:
    package-manager-install:
      pnpm-version: 9.11.0

That does not work still log

sh: line 1: pnpm: command not found

And I make sure the pnpm command work at all shell(bash/sh/zsh)

melloware commented 1 month ago

ok then its a bug.

melloware commented 1 month ago

i am pretty sure our CI/CD tests already test this on Linux but something must be different.

DaiYuANg commented 1 month ago

i am pretty sure our CI/CD tests already test this on Linux but something must be different.

May its nvm?

melloware commented 1 month ago

can you try it without NVM?

DaiYuANg commented 1 month ago

can you try it without NVM?

I remove nvm and using node install from system package manager (dnf) and its does work

melloware commented 1 month ago

ok so NVM is interfering somehow. Not sure what Quinoa can do here?

DaiYuANg commented 1 month ago

ok so NVM is interfering somehow. Not sure what Quinoa can do here?

Could we do something compatible for NVM. Like find $NVM_DIR and using binary in NVM current node version?

melloware commented 1 month ago

I will leave that as a question for @ia3andy