question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

installing node and npm execution does not respect .npmrc registry setting

See original GitHub issue

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:

<plugin>
    <groupId>com.github.eirslett</groupId>
    <artifactId>frontend-maven-plugin</artifactId>
    <version>1.7.6</version>
    <configuration>
        <nodeVersion>v10.13.0</nodeVersion>
        <npmVersion>6.9.0</npmVersion>
    </configuration>
    <executions>
        <execution>
            <id>install node and npm</id>
            <goals>
                <goal>install-node-and-npm</goal>
            </goals>
        </execution>
        <execution>
            <id>npm install</id>
            <goals>
                <goal>npm</goal>
            </goals>
        </execution>
    </executions>
</plugin>

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?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ajkimotocommented, Aug 2, 2021

I am embarrassed. It turns out that I needed to add the correct value in the <npmDownloadRoot> tag. All is well now.

1reaction
eirslettcommented, Jul 23, 2021

Why do you have <configuration> inside <configuration>?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is there a way to make npm install (the command) to work ...
I solved this problem this way: I run this command: npm config set strict-ssl false. Then set npm to run with http, instead...
Read more >
Configure Your NPM Registry Settings - Nono Martínez Alonso
Run the npm config list command to see what variables are set. If you run this in a project folder with an .npmrc...
Read more >
npm packages in the Package Registry - GitLab Docs
Ensure that your package scope is set consistently in your package.json and .npmrc files. For example, if your project name in GitLab is...
Read more >
Workspaces - npm Docs
Workspaces is a generic term that refers to the set of features in the npm cli that provides support to managing multiple packages...
Read more >
npm-install - npm Docs
With the --production flag (or when the NODE_ENV environment variable is set to production ), npm will not install modules listed in devDependencies...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found