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

Cannot run program "npx" error=2, No such file or directory #1082

Open
debraj-manna opened this issue Apr 13, 2023 · 0 comments
Open

Cannot run program "npx" error=2, No such file or directory #1082

debraj-manna opened this issue Apr 13, 2023 · 0 comments

Comments

@debraj-manna
Copy link

I am trying to use frontend-maven-plugin 1.12.1 with maven 3.8.4. My pom configuration looks like below. But on doing mvn clean install I am getting the below error

Error:  Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.1.0:exec (validate api specs) on project master: Command execution failed.: Cannot run program "npx" (in directory "/opt/actions-runner/_work/spotnana/spotnana/src/java/obt/master/target"): error=2, No such file or directory -> [Help 1]
Error:  

Can someone let me know what I am doing wrong?

<plugin>
        <groupId>com.github.eirslett</groupId>
        <artifactId>frontend-maven-plugin</artifactId>
        <version>1.12.1</version>
        <executions>
          <execution>
            <id>install node and npm</id>
            <goals>
              <goal>install-node-and-npm</goal>
            </goals>
            <!-- optional: default phase is "generate-resources" -->
            <phase>initialize</phase>
            <configuration>
              <installDirectory>target</installDirectory>
              <nodeVersion>v19.6.0</nodeVersion>
              <npmVersion>9.5.0</npmVersion>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>3.1.0</version>
        <executions>
          <execution>
            <id>install openapi merger</id>
            <goals>
              <goal>exec</goal>
            </goals>
            <phase>generate-resources</phase>
            <configuration>
              <executable>${project.basedir}/target/node/npm</executable>
              <workingDirectory>${project.basedir}/target/node</workingDirectory>
              <arguments>
                <argument>install</argument>
                <argument>openapi-merger</argument>
              </arguments>
            </configuration>
          </execution>
          <execution>
            <id>generate internal api spec</id>
            <goals>
              <goal>exec</goal>
            </goals>
            <phase>generate-resources</phase>
            <configuration>
              <executable>${project.basedir}/target/node/node_modules/.bin/openapi-merger
              </executable>
              <workingDirectory>${project.basedir}/target/node</workingDirectory>
              <environmentVariables>
                <PATH>${env.PATH}:${project.basedir}/target/node</PATH>
              </environmentVariables>
              <arguments>
                <argument>-i</argument>
                <argument>${project.basedir}/src/main/resources/yaml/apis/api/Api.yaml
                </argument>
                <argument>-o</argument>
                <argument>${project.basedir}/src/main/resources/api/InternalApiSpec.yaml</argument>
              </arguments>
            </configuration>
          </execution>
          <execution>
            <id>validate api specs</id>
            <goals>
              <goal>exec</goal>
            </goals>
            <phase>generate-resources</phase>
            <configuration>
              <executable>npx</executable>
              <workingDirectory>${project.basedir}/target</workingDirectory>
              <environmentVariables>
                <PATH>${env.PATH}:${project.basedir}/target/node</PATH>
              </environmentVariables>
              <arguments>
                <argument>@redocly/cli@latest</argument>
                <argument>lint</argument>
                <argument>${project.basedir}/src/main/resources/api/PolicyApi.yaml</argument>
                <argument>${project.basedir}/src/main/resources/api/CompanyApi.yaml</argument>
                <argument>${project.basedir}/src/main/resources/api/UsersApi.yaml</argument>
                <argument>${project.basedir}/src/main/resources/api/TripApi.yaml</argument>
                <argument>${project.basedir}/src/main/resources/api/InternalApiSpec.yaml</argument>
              </arguments>
            </configuration>
          </execution>
        </executions>
      </plugin>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant