Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can we confirm the installed 'npm' is the one actually being executed during the build? #1174

Open
joeclark-phd opened this issue Feb 12, 2025 · 1 comment

Comments

@joeclark-phd
Copy link

In the Maven log output, after Node and NPM are installed, there is a line like the following:

[INFO] Running 'npm install' in D:\my\project\repo\frontend

The question I'm faced with is, how do I know the npm that's running is the one that the plugin just installed? There is a global installation of npm on the build server, which may not be the desired version. I didn't see any log output that gave the full path of which npm is being called, nor did I see a log that said the new installation was being added to the PATH.

It might make sense to change the log line above to something that gives the full path to npm, if that's in fact what's being done, e.g.:

[INFO] Running 'D\my\project\repo\frontend\node\npm install' in D:\my\project\repo\frontend

But is that what's being done? Is there any possibility that the build might accidentally be using the global npm?

@eirslett
Copy link
Owner

Yeah it could sometimes happen, if your npm script forks off new processes that have other PATH configurations, working directories and so on. It's somewhat of an edge case. You could make Maven run npm --version I suppose - then at least you know that Maven itself uses the correct one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants