1

I am trying to use maven to compile my first JHipster basic app. I have node as an exe & npm as a symbolic link locally at the path /home/myuser/.nvm/versions/node/v16.17.0/bin (see ll below), and I want to use my local node & npm, not have maven install them both. The problem is that when I run mvn clean compile, I get the error at bottom.

To me, the error shows that somewhere in the pom /node/node is being appended to the path, when I only (I think) need /node appended.

Where am I getting the extra /node from?

The pom is large, but here is my frontend-maven-plugin (this is source for adding <installDirectory>):

<plugin>
    <groupId>com.github.eirslett</groupId>
    <artifactId>frontend-maven-plugin</artifactId>
    <executions>
        <execution>
            <id>webapp build dev</id>
            <goals>
                <goal>npm</goal>
            </goals>
            <phase>generate-resources</phase>
            <configuration>
                <arguments>run webapp:build</arguments>
                <environmentVariables>
                    <APP_VERSION>${project.version}</APP_VERSION>
                </environmentVariables>
                <npmInheritsProxyConfigFromMaven>false</npmInheritsProxyConfigFromMaven>
                <installDirectory>/home/myuser/.nvm/versions/node/v16.17.0/bin</installDirectory>
            </configuration>
        </execution>
    </executions>
</plugin>

I commented out these executions due to having node/npm locally installed (listed here in brief):

        <id>install-node-and-npm</id>
        <goals><goal>install-node-and-npm</goal></goals>

        <id>npm install</id>
        <goals><goal>npm</goal></goals>

Node location

> ll /home/myuser/.nvm/versions/node/v16.17.0/bin
...
drwxr-xr-x. 2 myuser mygroup     4096 Aug 16 02:36 .
drwxr-xr-x. 6 myuser mygroup     4096 Sep 12 17:39 ..
-rwxr-xr-x. 1 myuser mygroup 82214176 Aug 16 02:36 node
...

Error

Cannot run program "/home/myuser/.nvm/versions/node/v16.17.0/bin/node/node" (in directory "/home/myuser/Documents/projects/jhipster/firstApp"): error=20, Not a directory

I can paste the 1300 line pom.xml if needed.

I tried adding the exec-maven-plugin based on this, but the error persisted.

UPDATE
For reasons beyond this scope, using node/npm locally is currently my only option, so I do not need maven to install them.

chocalaca
  • 330
  • 2
  • 17

0 Answers0