AEM Project frontend-maven-plugin proxy setting local registry instead of reaching to internet or internal or private reposity | Community
Skip to main content
Level 5
April 9, 2024
Solved

AEM Project frontend-maven-plugin proxy setting local registry instead of reaching to internet or internal or private reposity

  • April 9, 2024
  • 1 reply
  • 1445 views

Hi Team

 

Currently we restrict to internet or public repository only use private repository.

 

we are not able to build the build the ui-frontend module because. 

frontend-maven-plugin required install node and npm which restricted. Kindly advise how refer the proxy local registry.
 
Here is Error:
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.3.2:exec (npm install (clean)) on project dmaf.ui.frontend: Command execution failed.: Process exited with an error: 1 (Exit value: 1) -> [Help 1]
 
npm ERR! code ETIMEDOUT
npm ERR! syscall connect
npm ERR! errno ETIMEDOUT
npm ERR! network request to https://registry.npmjs.org/acorn failed, reason: connect ETIMEDOUT 104.16.31.34:443
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
 
ui-frontend module POM.xml
<plugin>
                <groupId>com.github.eirslett</groupId>
                <artifactId>frontend-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>npm run prod</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>npm</goal>
                        </goals>
                        <configuration>
                            <arguments>run prod</arguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

main pom.xml

<configuration>
<nodeVersion>v18.18.2</nodeVersion>
            <npmVersion>9.8.1</npmVersion>
          </configuration>


Local env

npm and node versions same

C:\Users\userid\npmrc.txt 

always-auth=true

registry=http://xxxxxxxxxxxxxxxx/nexus/repository/Publicnpm/

//xxxxxxxxxxx:8081/:_auth=xxxxxxxxxxxxxxxxx


Not sure how to check npmrc.txt  configuration working or not?

Regards

Vara

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SureshDhulipudi

npmrc is the file type - it should not be .txt.

 

If you are using windows - check the Type in windows explorer, this should be NPMRC File.

To create .npmrc file, open a notepad , enter registry and proxy details, click on File Save As 

 

in save prompt - enter file name as --> .npmrc and 

Save as Type: All Files (*.*) - please note default it will be *.txt (Text document) 

 

1 reply

SureshDhulipudi
Community Advisor
SureshDhulipudiCommunity AdvisorAccepted solution
Community Advisor
April 10, 2024

npmrc is the file type - it should not be .txt.

 

If you are using windows - check the Type in windows explorer, this should be NPMRC File.

To create .npmrc file, open a notepad , enter registry and proxy details, click on File Save As 

 

in save prompt - enter file name as --> .npmrc and 

Save as Type: All Files (*.*) - please note default it will be *.txt (Text document) 

 

varaandeAuthor
Level 5
April 10, 2024

Hi Suresh

I had followed instructions (file name .npmrc instead of npmrc and type also npmrc not text) But still not taking proxy settings.

Please let me know how need make sure .npmrc details executed & any option check log taking values.

 

Regards

Vara