-
Notifications
You must be signed in to change notification settings - Fork 160
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
fix: linux node installation (#14657) (CP: 23.2) #14825
Conversation
Fix installation of node for unix systems. NodeJS 18 is more strict about where the contents are located than old versions. Fixes #14636
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
@@ -33,7 +33,9 @@ public class FrontendStubs { | |||
public static final String VITE_SERVER = "node_modules/vite/bin/vite.js"; | |||
public static final String VITE_TEST_OUT_FILE = "vite-out.test"; | |||
|
|||
private static final String NPM_BIN_PATH = "node/node_modules/npm/bin"; | |||
private static final String NPM_BIN_PATH = System.getProperty("os.name") | |||
.startsWith("Windows") ? "node/node_modules/npm/bin/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NULL_DEREFERENCE: object returned by getProperty("os.name")
could be null and is dereferenced at line 37.
ℹ️ Learn about @sonatype-lift commands
You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.
Command | Usage |
---|---|
@sonatype-lift ignore |
Leave out the above finding from this PR |
@sonatype-lift ignoreall |
Leave out all the existing findings from this PR |
@sonatype-lift exclude <file|issue|path|tool> |
Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file |
Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.
Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]
@@ -315,7 +317,8 @@ private void extractUnixNpm(InstallData data, File destinationDirectory) | |||
File tmpNodeModulesDir = new File(data.getTmpDirectory(), | |||
data.getNodeFilename() + File.separator + "lib" + File.separator | |||
+ FrontendUtils.NODE_MODULES); | |||
File nodeModulesDirectory = new File(destinationDirectory, | |||
File nodeModulesDirectory = new File( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💬 3 similar findings have been found in this PR
PATH_TRAVERSAL_IN: This API (java/io/File.(Ljava/lang/String;Ljava/lang/String;)V) reads a file whose location might be specified by user input
🔎 Expand here to view all instances of this finding
File Path | Line Number |
---|---|
flow-server/src/main/java/com/vaadin/flow/server/frontend/FrontendTools.java | 1069 |
flow-server/src/main/java/com/vaadin/flow/server/frontend/installer/NodeInstaller.java | 332 |
flow-server/src/main/java/com/vaadin/flow/server/frontend/installer/NodeInstaller.java | 446 |
Visit the Lift Web Console to find more details in your report.
ℹ️ Learn about @sonatype-lift commands
You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.
Command | Usage |
---|---|
@sonatype-lift ignore |
Leave out the above finding from this PR |
@sonatype-lift ignoreall |
Leave out all the existing findings from this PR |
@sonatype-lift exclude <file|issue|path|tool> |
Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file |
Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.
Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]
This ticket/PR has been released with Vaadin 23.2.6. |
Fix installation of node for unix systems. NodeJS 18 is more strict about where the contents are located than old versions. Fixes #14636 Co-authored-by: caalador <mikael.grankvist@vaadin.com> # Conflicts: # flow-test-generic/src/main/java/com/vaadin/flow/testutil/FrontendStubs.java
Fix installation of node for unix systems. NodeJS 18 is more strict about where the contents are located than old versions. Fixes #14636 Co-authored-by: caalador <mikael.grankvist@vaadin.com> # Conflicts: # flow-test-generic/src/main/java/com/vaadin/flow/testutil/FrontendStubs.java Co-authored-by: Artur <artur@vaadin.com>
Fix installation of node for unix systems.
NodeJS 18 is more strict about where
the contents are located than old versions.
Fixes #14636