#vulnerable code 
                                public void install() throws InstallationException {
        if(nodeDownloadRoot == null || nodeDownloadRoot.isEmpty()){
            nodeDownloadRoot = DEFAULT_NODEJS_DOWNLOAD_ROOT;
        }
        if(npmDownloadRoot == null || npmDownloadRoot.isEmpty()){
            npmDownloadRoot = DEFAULT_NPM_DOWNLOAD_ROOT;
        }
        synchronized (lock) {
            if (!nodeIsAlreadyInstalled()) {
                logger.info("Installing node version {}", nodeVersion);
                if (!nodeVersion.startsWith("v")) {
                    logger.warn("Node version does not start with naming convention 'v'.");
                }
                if (config.getPlatform().isWindows()) {
                    installNodeForWindows();
                } else {
                    installNodeDefault();
                }
            }
            if (!npmIsAlreadyInstalled()) {
                installNpm();
            }
        }
    } 
                            #location 6 
                            #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code
                                public void install() throws InstallationException {
        // use static lock object for a synchronized block
        synchronized (LOCK) {
            if(nodeDownloadRoot == null || nodeDownloadRoot.isEmpty()){
                nodeDownloadRoot = DEFAULT_NODEJS_DOWNLOAD_ROOT;
            }
            if(npmDownloadRoot == null || npmDownloadRoot.isEmpty()){
                npmDownloadRoot = DEFAULT_NPM_DOWNLOAD_ROOT;
            }
            if (!nodeIsAlreadyInstalled()) {
                logger.info("Installing node version {}", nodeVersion);
                if (!nodeVersion.startsWith("v")) {
                    logger.warn("Node version does not start with naming convention 'v'.");
                }
                if (config.getPlatform().isWindows()) {
                    installNodeForWindows();
                } else {
                    installNodeDefault();
                }
            }
            if (!npmIsAlreadyInstalled()) {
                installNpm();
            }
        }
    }