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

NodeJS auto-update doesn't work if alternative directory is forced #12264

Closed
mshabarov opened this issue Nov 3, 2021 · 1 comment · Fixed by #12270
Closed

NodeJS auto-update doesn't work if alternative directory is forced #12264

mshabarov opened this issue Nov 3, 2021 · 1 comment · Fixed by #12270

Comments

@mshabarov
Copy link
Contributor

Description of the bug / feature

NodeJS auto-update doesn't work if alternative directory is forced.

Minimal reproducible example

  1. Download a fresh starter project from start.vaadin.com with Vaadin 22 (pre).
  2. Create a new file pom.xml in your ~/.vaadin folder and put the following content there
<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>com.quick.installer</groupId>
  <artifactId>quick-installer</artifactId>
  <version>1.0-SNAPSHOT</version>

  <name>Node quick installer pom</name>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>1.7</maven.compiler.source>
    <maven.compiler.target>1.7</maven.compiler.target>
  </properties>


  <build>
    <plugins>
      <plugin>
        <groupId>com.github.eirslett</groupId>
        <artifactId>frontend-maven-plugin</artifactId>
        <!-- Use the latest released version:
        https://repo1.maven.org/maven2/com/github/eirslett/frontend-maven-plugin/ -->
        <version>1.9.1</version>
        <executions>
          <execution>
            <!-- optional: you don't really need execution ids, but it looks nice in your build log. -->
            <id>install node and npm</id>
            <goals>
              <goal>install-node-and-npm</goal>
            </goals>
          </execution>
        </executions>

      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>old</id>

      <build>
        <plugins>
          <plugin>
            <groupId>com.github.eirslett</groupId>
            <artifactId>frontend-maven-plugin</artifactId>
            <configuration>
              <nodeVersion>v7.7.3</nodeVersion>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>shouldWork</id>

      <build>
        <plugins>
          <plugin>
            <groupId>com.github.eirslett</groupId>
            <artifactId>frontend-maven-plugin</artifactId>
            <configuration>
              <nodeVersion>v12.2.0</nodeVersion>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
  1. Run mvn install -Pold in ~/.vaadin. Check that the installed Node.js version is 7.x.
  2. Add vaadin.require.home.node=true to application.properties.
  3. Start your project, wait until the application starts completely.

Expected behavior

Node version is updated to 16.x

Actual behavior

Error is shown:

[ERROR] Your installed 'node' version (7.7.3) is too old. Supported versions are 12.22+
[ERROR] Please install a new one either:
[ERROR]   - by following the https://nodejs.org/en/download/ guide to install it globally
[ERROR]   - or by running the frontend-maven-plugin goal to install it in this project:
[ERROR]   $ mvn com.github.eirslett:frontend-maven-plugin:1.7.6:install-node-and-npm -DnodeVersion="v12.14.0"

Versions:

- Vaadin / Flow version: 22.0.0.beta1
@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with platform 22.0.0.beta2 and is also targeting the upcoming stable 22.0.0 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment