Node.exe in C:\Users\{userName}\.webclipse\nodejs blocked by Group Policy

Tagged: 

This topic contains 2 replies, has 2 voices, and was last updated by  support-tony 5 months, 1 week ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #579777 Reply

    jeffatwork
    Participant

    In our locked-down corporate environment, we can only launch executables from 3 locations: “C:\Program Files”, “C:\Program Files (x86)” and a third folder I’ll call “C:\Work”. Any executable in a different location such as “C:\Users\{userName}\.webclipse\nodejs\node-v4.2.4-win32-x86_64” will be blocked by Group Policy.

    We first tried Angular IDE, but found that even attempting to launch the product failed on this error before a workspace could even be opened. The IT staff eventually declared they could not support it.

    We are now trying the Webclipse plugin and are hitting similar issues for which there seem to be partial workarounds but this too may prove unsupportable. I’m hoping someone else has found a solution. My environment is Windows 7 Enterprise, using both STS 3.8.3 and Neon 3.4.6 and Chrome. I have NODE_HOME pointing in to a 6.10.3 installation in “C:\Work\software\Nodejs” and have %NODE_HOME% (and its npm sub-folder) in the PATH. The Angular projects are all in a Git repo.

    First, Webclipse installs Nodejs and npm in the “.\webclipse” subfolder within my Users folder as noted above. It apparently ignores NODE_HOME altogether. As a result, any npm install will fail as will attempts to start an Angular project via the Angular-CLI server.

    Here’s what I’ve tried:

    • Went to Window -> Preferences ->TypeScript and pointed the “Node.js runtime” to my installation in C:\Work – no effect.
    • Went to the projects Properties -> CLI Tool Management and selected the Node.js and NPM versions in C:\Work. This appears to have had the effect of the plugin downloading those versions into my Users folder. No effect on the problem.
    • Went to the Angular-CLI Properties and saw that “Default Project Installation (6.10.3)” was selected. I though that was OK, but then I saw the “Configure Node’js installations” link, and that’s when I discovered it had installed new copies of those versions in my Users folder.

    So is there any way to get Webclipse to use my installations in C:\Work? Perhaps some bit of metadata that it’s not exposing in the Properties dialogs? If not I’ll have to abandon Webclipse altogether and probably use IntelliJ (and I understand there’s a “learning wall” when coming in as an eclipse/STS user).

    #579838 Reply

    jeffatwork
    Participant

    The solution is to create a Junction, which is basically a symlink to a folder using the mklink (“make link”) command.
    Here’s what to do:

    1. Install the WebClipse plugin from the Eclipse Marketplace
    2. Close all workspaces using the eclipse or STS installation into which the plugin has been installed
    3. In Windows Explorer, move the folder “C:\User\{yourUserId}\.webclipse” to “C:\WORK\software” (or where ever your IT team says you can execute from).
      You could also copy it (like I did), but then you‘ll have to rename the original before creating the junction.
    4. Open a command shell and issue the following command (you must include the enclosing quotes):
      mklink /J “C:\Users\{yourUserId}\.webclipse” “C:\Work\software\.webclipse”
    5. Reopen your workspace. You should now be able to start the server, compile, etc.

    Note that this will probably also work for the full Angular IDE. I may test that tomorrow.

    • This reply was modified 5 months, 1 week ago by  jeffatwork.
    • This reply was modified 5 months, 1 week ago by  jeffatwork.
    • This reply was modified 5 months, 1 week ago by  jeffatwork.
    #580074 Reply

    support-tony
    Keymaster

    Jeff,

    The symlink is a good idea and will be helpful to others in this situation, so thanks for posting the idea.

    There are a couple of other ways to deal with this specific problem.

    1. Add a -Duser.home=C:/Work/software (using your example) to the eclipse.ini file vm arguments. This will set the user home to the location from which you can execute programs. All eclipse related files that are created in your user home folder will be created in this specified location
    2. For Angular projects, ensure you specify the system installed node and npm versions when creating the projects and also ensure that you have a system installation of git-bash.

    These are rough outlines, there may be other tweaks that would be needed. Your idea is probably the least disruptive overall but there may be situations where one of the other solutions is more appropriate.

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: Node.exe in C:\Users\{userName}\.webclipse\nodejs blocked by Group Policy

This topic is marked as closed to new replies, however your posting capabilities still allow you to do so.