Closed ajkimoto closed 3 years ago
By default, the plugin will download node and npm via the proxy you have configured in your Maven settings: https://github.com/eirslett/frontend-maven-plugin#proxy-settings
@eirslett - thanks for the link - so you're saying that disabling npm's inheritance of the proxy settings from maven will make it respect the .npmrc file? Otherwise I'm failing to see the connection to the author's issue with the npmrc file to the proxy configs you've linked to... could you please explicitly state whatever point or inferences you were hoping to communicate by posting the link above as it relates to the author's problem?
I believe disabling the inheritance stuff will make it respect npmrc. I don't use any proxies myself, so I can't say for sure. Do you have a similar problem?
Disabling the proxy has not helped me solve the same issue. In my case the npmrc is in home dir (~/.npmrc), and the same directory of the pom.xml, and in the parent directory. It still doesn't seem to be respecting the npmrc file.
Is there a better place to put the npmrc? Perhaps a config could be added for it.
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.10.4</version>
<configuration>
<!-- nodeVersion>provided</nodeVersion> <npmVersion>provided</npmVersion -->
<nodeVersion>v14.8.0</nodeVersion>
<npmVersion>6.14.7</npmVersion>
<workingDirectory>./</workingDirectory>
<configuration>
<npmInheritsProxyConfigFromMaven>false</npmInheritsProxyConfigFromMaven>
</configuration>
</configuration>
<executions>
<execution>
<id>install-node-and-npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
</execution>
<execution>
<id>npm-run-build</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>run custom-build-step</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
Why do you have <configuration>
inside <configuration>
?
I am embarrassed. It turns out that I needed to add the correct value in the <npmDownloadRoot> tag. All is well now.
I have tried using .npmrc to set the npm registry, but is ignored by the install node and npm execution. However, If I change the nodeVersion and npmVersion in that step to to provided (to prevent the attempted npm/node downloads), the setting in .npmrc is respected by the subsequent npm install execution. I have seen this same behavior now in completely different projects.
I have tried placing .npmrc is in the parent directory of the pom.xml and also in the same directory as the pom.xml
Configuration is like this:
Watching the build, I can see it attempting to download (for example) npm from:
https://registry.npmjs.org/npm/-/npm-6.9.0.tgz
Instead of our internal mirror as defined in .npmrc.
Any suggestions?