Class NpmPathResolver


  • public class NpmPathResolver
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      NpmPathResolver​(java.io.File explicitNpmExecutable, java.io.File explicitNodeExecutable, java.io.File explicitNpmrcFile, java.util.List<java.io.File> additionalNpmrcLocations)  
    • Constructor Detail

      • NpmPathResolver

        public NpmPathResolver​(java.io.File explicitNpmExecutable,
                               java.io.File explicitNodeExecutable,
                               java.io.File explicitNpmrcFile,
                               java.util.List<java.io.File> additionalNpmrcLocations)
    • Method Detail

      • resolveNpmExecutable

        public java.io.File resolveNpmExecutable()
        Finds the npm executable to use.
        Either the explicit npm executable is returned, or - if an explicit node executable is configured - tries to find the npm executable relative to the node executable. Falls back to looking for npm on the user's system using NpmExecutableResolver
        Returns:
        the npm executable to use
        Throws:
        java.lang.IllegalStateException - if no npm executable could be found
      • resolveNodeExecutable

        public java.io.File resolveNodeExecutable()
        Finds the node executable to use.
        Either the explicit node executable is returned, or tries to find the node executable relative to the npm executable found by resolveNpmExecutable().
        Returns:
        the node executable to use
        Throws:
        java.lang.IllegalStateException - if no node executable could be found
      • resolveNpmrcContent

        public java.lang.String resolveNpmrcContent()