nodists/nodist

Does not work well without Admin perms

osher opened this issue · 15 comments

osher commented

If I'm already here, then lets report this one too...

I could not use nodist on the corporate machine, on which I have no admin privileges.

I did get one of our IT-Ops to install it for me, and I tried to use it - but I got weird indecisive behaviors every time I used node and every time I tried to change versions.

using NPM left a trail of [ \ - / | \ - / .... ] consuming all my shell buffer
Changing versions did not really work
also changing npm versions did not behave as expected as well.

Using it on a machine logged as a user with proper admin perms works as expected.

Obviously it's about perms...

Any advise?
Is there a way I can show my Ops manager how to install Nodist to work for developers without asking to give them admin perms?

Mmmh. The problem is probably the default install path in C:\Program Files, installing somewhere else (where no admin permissions are required for writing files) might work. Will check on my machine. Thanks for reporting!

I cannot reproduce this, weirdly. Can you provide steps to reproduce and windows version, please? Enabling nodist debug output via set DEBUG=nodist:* can also help clear up issues. :/

I have the same issue. Nodist doesn't change the node version no matter which prompt is used. I do have admin rights on the box.

image

Engines in my package.json:

  "engines": {
    "node": ">=4.5.0",
    "npm": ">=3"
  },

Using nvm-windows seems to work (note how it asks for elevation on regular prompt):

image

image

On admin prompt:

image

When having set DEBUG=nodist:*, running node should give you debug output as well. This probably means, you're not actually running nodist's node.exe. Please check your PATH and make sure there is no other directory with a node.exe there (also don't put path\to\nodist in your PATH; it's gotta be path\to\nodist\bin!)

That could be it. But shouldn't the installer take care of that?

The installer should put path\to\nodist\bin in your PATH. The system PATH, iirc. It doesn't remove anything from it and doesn't check whether running node executes the right binary. Something obviously has gone wrong for you though and I'd really like to find out what. Can you check your PATH? (Something that should be obvious, but isn't from the docs: Installing nvm-windows after nodist breaks nodist. There can only be one.)

Well I don't have nodist installed anymore (sorry!). But all of those screenshots are from before I installed nvm.

My current path looks like this:

C:\Users\mrchief\AppData\Local\Programs\Python\Python35-32\Scripts\;C:\Users\mrchief\AppData\Local\Programs\Python\Python35-32\;C:\Users\mrchief\.dnx\bin;C:\Ruby22-x64\bin;C:\Program Files (x86)\MSBuild\14.0\Bin;C:\Program Files (x86)\WiX Toolset v3.9\bin;C:\git-tfs;d:\src\tools;C:\Users\mrchief\AppData\Roaming\npm;C:\Program Files (x86)\Microsoft VS Code\bin;C:\Program Files\Sublime Text 3;C:\Program Files\Docker Toolbox;F:\PortableApps\nginx-1.8.0;F:\PortableApps\Packer;%NVM_HOME%;%NVM_SYMLINK%

Obviously, the NVMxxx got added after I installed nvm.

@osher Can you confirm DEBUG=nodist:* not producing any output when running node? In that case the output of node -e "console.log(process.execPath)" would be interesting.

osher commented

I had to tweak my path so I could work, mind you, so my machine is by definition not typical.
I'm waiting for the next stable release to re-install in a custom place (not in Program Files)
(because of corp procedures I have to get devops to do that, so I'd like to minimize messing with the system, I already "consumed my credit" for the rest of the year... 😛 )

osher commented

Mmm. mind you that updating the System PATH requires admin perms as well.

when switching node version in non elevated prompt the prefix is set to C:\tools\Nodist\v-x64\7.2.0
When in an elevated prompt prefix is set to C:\tools\Nodist\bin

Very annoying

@Casz Hi. Which prefix are you talking about? NODIST_PREFIX? Or the prefix of the output of node -e "console.log(process.execPath)"? Or something else?

npm config get prefix
The global bin

Ahh, interesting. Can you fix it by setting npm config set prefix "%NODIST_PREFIX%\bin" in non-elevated prompt? Also, @Casz do you experience the same issue with nodist not actually changing the node version, as @mrchief described?