package.json dependency version mismatching on tutorial exercises project

hi there, I’m new to vaadin 14 and try to following training to build a vaadin 14 project.
I got error when running the exercises project (Downloaded on training page, at layouting part) by following the tutorial (https://vaadin.com/learn/tutorials/import-maven-project-intellij-idea) and documentation,

npm ERR! code ETARGET
npm ERR! notarget No matching version found for @vaadin/vaadin-time-picker@2.0.4.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! notarget 
npm ERR! notarget It was specified as a dependency of '@vaadin/flow-deps'
npm ERR! notarget 

I npm install @vaadin/vaadin-time-picker

now I got another dependency miss matching version error

npm ERR! code ETARGET
npm ERR! notarget No matching version found for chownr@^1.1.2
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! notarget 
npm ERR! notarget It was specified as a dependency of 'cacache'
npm ERR! notarget 

I didn’t make any changes on package.json file, only manually install date picker package

{
"name": "no-name",
  "license": "UNLICENSED",
  "dependencies": {
    "@polymer/polymer": "3.2.0",
    "@vaadin/flow-deps": "./target/frontend",
    "@vaadin/vaadin-time-picker": "^1.2.2",
    "@webcomponents/webcomponentsjs": "^2.2.10"
  },
  "devDependencies": {
    "compression-webpack-plugin": "3.0.1",
    "copy-webpack-plugin": "5.1.0",
    "raw-loader": "3.0.0",
    "webpack": "4.30.0",
    "webpack-babel-multi-target-plugin": "2.3.3",
    "webpack-cli": "3.3.10",
    "webpack-dev-server": "3.9.0",
    "webpack-merge": "4.2.2"
  },
  "vaadinAppPackageHash": "..."
  }
npm version 6.14.5
node version v13.8.0

all vaadin 14 projects I downloaded got some dependency version matching error on npm install, I tried remove package.json & node_modules, none of them works.

any ideas for this?

cheers!

Have you tried updating the Vaadin version?

Alejandro Duarte:
Have you tried updating the Vaadin version?

Hi Alejandro, I add vaadin dependency to pom file. The project was downloaded from https://vaadin.com/learn/training/v14-layouting

my pom file is following, didn’t change other stuff, only add vaadin denpendency, not sure if its correct

<modelVersion>4.0.0</modelVersion>
    <artifactId>exercises</artifactId>
    <name>Exercises</name>
    <packaging>war</packaging>

    <parent>
        <groupId>com.vaadin.training</groupId>
        <artifactId>v14-layouting</artifactId>
        <version>1.0-SNAPSHOT</version>
    </parent>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin</artifactId>
                <version>14.2.1</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>
            <!-- Jetty plugin for easy testing without a server -->
            <plugin>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                <configuration>
                    <!-- If using IntelliJ IDEA with autocompilation, this
                    might cause lots of unnecessary compilations in the
                    background.-->
                    <scanIntervalSeconds>2</scanIntervalSeconds>
                    <!-- Use war output directory to get the webpack files -->
                    <webAppConfig>
                        <allowDuplicateFragmentNames>true</allowDuplicateFragmentNames>
                    </webAppConfig>
                </configuration>
            </plugin>

            <!--
                Take care of synchronizing java dependencies and imports in
                package.json and main.js files.
                It also creates webpack.config.js if not exists yet.
            -->
            <plugin>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <profile>
            <id>it</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.eclipse.jetty</groupId>
                        <artifactId>jetty-maven-plugin</artifactId>
                        <configuration>
                            <scanIntervalSeconds>0</scanIntervalSeconds>
                            <stopPort>8081</stopPort>
                            <stopWait>5</stopWait>
                            <stopKey>${project.artifactId}</stopKey>
                        </configuration>
                        <executions>
                            <execution>
                                <id>start-jetty</id>
                                <phase>pre-integration-test</phase>
                                <goals>
                                    <goal>deploy-war</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>stop-jetty</id>
                                <phase>post-integration-test</phase>
                                <goals>
                                    <goal>stop</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- Runs the integration tests (*IT) after the server is started -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <configuration>
                            <trimStackTrace>false</trimStackTrace>
                            <enableAssertions>true</enableAssertions>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>gitlab-it</id>
            <properties>
                <vaadin.productionMode>true</vaadin.productionMode>
            </properties>

            <dependencies>
                <dependency>
                    <groupId>com.vaadin</groupId>
                    <artifactId>flow-server-production-mode</artifactId>
                </dependency>
            </dependencies>

            <build>
                <plugins>
                    <plugin>
                        <groupId>com.vaadin</groupId>
                        <artifactId>vaadin-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>prepare-frontend</goal>
                                    <goal>build-frontend</goal>
                                </goals>
                                <phase>compile</phase>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.eclipse.jetty</groupId>
                        <artifactId>jetty-maven-plugin</artifactId>
                        <configuration>
                            <scanIntervalSeconds>0</scanIntervalSeconds>
                            <stopPort>8081</stopPort>
                            <stopWait>5</stopWait>
                            <stopKey>${project.artifactId}</stopKey>
                        </configuration>
                        <executions>
                            <execution>
                                <id>start-jetty</id>
                                <phase>pre-integration-test</phase>
                                <goals>
                                    <goal>deploy-war</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>stop-jetty</id>
                                <phase>post-integration-test</phase>
                                <goals>
                                    <goal>stop</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

I meant updating not adding. Try just updating the version in the parent pom.xml file. You probably have to remove the json files and node directories as well.

Alejandro Duarte:
I meant updating not adding. Try just updating the version in the parent pom.xml file. You probably have to remove the json files and node directories as well.

Seems my npm registry url pointed wrong and it couldn’t update the latest packages, I changed npm registry and update vaadin version solved the problem. Thanks for helping out!

I have a question in the same range.
I got the next list of warnings when I started the spring/vaadin application:

npm WARN deprecated core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated

After that I tried to access npm, but this failed with the message ‘module not found’

I am working on a mac.

What can I do now?

Huib Valstar:
I have a question in the same range.
I got the next list of warnings when I started the spring/vaadin application:

npm WARN deprecated core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated

After that I tried to access npm, but this failed with the message ‘module not found’

I am working on a mac.

What can I do now?

I got these warning as well, you npm install should still able to work anyway. There are some changes they have made recently https://github.com/vaadin/flow/commit/5d4230917dc0baf4a72661c2cdcbd80b84d90d2e