eirslett / frontend-maven-plugin

"Maven-node-grunt-gulp-npm-node-plugin to end all maven-node-grunt-gulp-npm-plugins." A Maven plugin that downloads/installs Node and NPM locally, runs NPM install, Grunt, Gulp and/or Karma.
Apache License 2.0
4.24k stars 869 forks source link

Proxy URLs, npm config registry, Node-npm-angular packages - E401 #652

Open narayanai opened 7 years ago

narayanai commented 7 years ago

Hi, I am getting E401 error while building my application. However the node and npm installed successfully from my proxy repository (execution 1). The npm install... is failing.(execution 2)

I have experimented various options in existing issue threads by using .npmrc file (like adding the 'registry', '_auth' etc) but no use.

Could anyone help me in resolving the same. Please see the below pom.xml

<plugin>
    <groupId>com.github.eirslett</groupId>
    <artifactId>frontend-maven-plugin</artifactId>
    <version>1.5</version>
    <configuration>
        <workingDirectory>./angular</workingDirectory>
        <installDirectory>target</installDirectory>
    </configuration>
    <executions>
        <execution>
            <id>install node and npm</id>
            <goals>
                <goal>install-node-and-npm</goal>
            </goals>
            <configuration>
                <serverId>${server.from.settings.xml}</serverId>
                <nodeDownloadRoot>${https.proxy.node.download.root}</nodeDownloadRoot>
                <npmDownloadRoot>${https.proxy.npm.download.root}</npmDownloadRoot>
                <nodeVersion>v6.9.1</nodeVersion>
                <npmVersion>3.10.10</npmVersion>
            </configuration>
        </execution>

        <execution>
            <id>npm install</id>
            <goals>
                <goal>npm</goal>
                </goals>
            <configuration>
                <serverId>${server.from.settings.xml}</serverId>
                <arguments>install --registry=${https.proxy.npm.registry.url}  --strict-ssl=false</arguments>
                </configuration>
            </execution>

        <execution>
            <id>npm build</id>
            <goals>
                <goal>npm</goal>
            </goals>
            <configuration>
                <arguments>run build</arguments>
            </configuration>
        <execution>
    </executions>
<plugin>
gronono commented 5 years ago

I don't know if this will help you but here my pom file :

<plugin>
                <groupId>com.github.eirslett</groupId>
                <artifactId>frontend-maven-plugin</artifactId>
                <version>${frontend-maven-plugin.version}</version>
                <configuration>
                    <nodeVersion>${node.version}</nodeVersion>
                    <downloadRoot>${node.url}</downloadRoot>
                </configuration>
                <executions>
                    <execution>
                        <id>install-node-and-npm</id>
                        <goals>
                            <goal>install-node-and-npm</goal>
                        </goals>
                        <phase>generate-resources</phase>
                    </execution>
                    <execution>
                        <id>set-npm-registry</id>
                        <goals>
                            <goal>npm</goal>
                        </goals>
                        <phase>generate-resources</phase>
                        <configuration>
                            <arguments>config set registry=${npm.registry.url}</arguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>