Class NodeInstaller
java.lang.Object
com.vaadin.flow.server.frontend.installer.NodeInstaller
Node installation class.
Derived from eirslett/frontend-maven-plugin
For internal use only. May be renamed or removed in a future release.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionNodeInstaller(File installDirectory, Platform platform, com.vaadin.frontendtools.installer.ArchiveExtractor archiveExtractor, FileDownloader fileDownloader) Initialize a new NodeInstaller.NodeInstaller(File installDirectory, Platform platform, List<ProxyConfig.Proxy> proxies) Create NoodeInstaller with default extractor and downloader.NodeInstaller(File installDirectory, List<ProxyConfig.Proxy> proxies) Create NodeInstaller with default extractor and downloader and guess platform. -
Method Summary
Modifier and TypeMethodDescriptionvoidinstall()Install node and npm.setNodeDownloadRoot(URI nodeDownloadRoot) Set a custom download root.setNodeVersion(String nodeVersion) Set the node version to install.setPassword(String password) Set password to use.setUserName(String userName) Set user name to use.
-
Field Details
-
INSTALL_PATH_PREFIX
- See Also:
-
SHA_SUMS_FILE
- See Also:
-
PROVIDED_VERSION
- See Also:
-
ACCEPT_MISSING_SHA
- See Also:
-
DEFAULT_NODEJS_DOWNLOAD_ROOT
- See Also:
-
UNOFFICIAL_NODEJS_DOWNLOAD_ROOT
- See Also:
-
-
Constructor Details
-
NodeInstaller
Create NodeInstaller with default extractor and downloader and guess platform.- Parameters:
installDirectory- installation directoryproxies- list of proxies
-
NodeInstaller
Create NoodeInstaller with default extractor and downloader.- Parameters:
installDirectory- installation directoryplatform- platform informationproxies- list of proxies
-
NodeInstaller
public NodeInstaller(File installDirectory, Platform platform, com.vaadin.frontendtools.installer.ArchiveExtractor archiveExtractor, FileDownloader fileDownloader) Initialize a new NodeInstaller.- Parameters:
installDirectory- installation directoryplatform- platform informationarchiveExtractor- archive extractorfileDownloader- file downloader
-
-
Method Details
-
setNodeVersion
Set the node version to install. (given as "v16.0.0")- Parameters:
nodeVersion- version string- Returns:
- this
-
setNodeDownloadRoot
Set a custom download root.This should be a url or directory under which we can find a directory
nodeVersionand there should then exist the archived node packages. For instance for v16.0.0 we should have under nodeDownloadRoot: ./v16.0.0/node-v16.0.0-linux-x64.tar.xz ./v16.0.0/node-v16.0.0-darwin-x64.tar.gz ./v16.0.0/node-v16.0.0-win-x64.zip ./v16.0.0/node-v16.0.0-win-x86.zip- Parameters:
nodeDownloadRoot- custom download root- Returns:
- this
-
setUserName
Set user name to use.- Parameters:
userName- user name- Returns:
- this
-
setPassword
Set password to use.- Parameters:
password- password- Returns:
- this
-
install
Install node and npm. This method unconditionally downloads and installs the specified node version without checking if it already exists. Use NodeResolver to check for existing installations before calling this.- Throws:
InstallationException- exception thrown when installation fails
-
getInstallDirectory
-