You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Installing into python venv overwrites VIRTUAL_ENV environment variable #243
When I install nodeenv on my Windows 10 machine with Python 3.7.4 I get the following:
> python -m venv .venv
...
> .venv\Scripts\Activate.ps1
(.venv) > pip install nodeenv
... (installs version 1.3.3)
(.venv) > nodeenv -p
* Install prebuilt node (13.1.0) ..... done.
* Overwriting c:\users\u\ws\.venv\Scripts\activate.bat with new content
* Overwriting c:\users\u\ws\.venv\Scripts\deactivate.bat with new content
* Overwriting c:\users\u\ws\.venv\Scripts\Activate.ps1 with new content
You do not have sufficient privilege to perform this operation.
You do not have sufficient privilege to perform this operation.
Error: Failed to create nodejs.exe link
* Install npm.js (latest) ...
(.venv) >
Why does nodenv overwrite the activate scripts removing the VIRTUAL_ENV environment variable? I see it sets the NODE_PATH and NODE_VIRTUAL_ENV environment variables (updating the PATH to include them). I feel that this is wrong. Other scripts may use VIRTUAL_ENV to determine the context they are running in and this breaks them.
Should it not APPEND to the existing activate script (i.e. add NODE_VIRTUAL_ENV/NODE_PATH leaving the rest alone) rather than overwrite it?
P.S. I see some errors regarding insuffucient privileges to perform some operation. Is that normal? Maybe the resulting activate scripts are like that due to the failing part of the setup?
Activity
asottile commentedon Dec 31, 2019
appears to just be an oversight --
nodeenv/nodeenv.py
Lines 900 to 905 in e0914dd
as for the permission errors, it's likely attempting to
symlink(which is fine if it can't)ravigupta-design commentedon Sep 18, 2020
@karypid , I think what you need to do is after activating python venv and installing nodeenv, you need to create the nodeenv environment like this:
$ nodeenv envwhere env is the name of the nodeenv environment and you can name it as per your wish.
And, then activate it.
You can find more information here: https://ekalinin.github.io/nodeenv/
fix(nodeenv): keep the python virtualenv's scripts under -p on Windows