I am using Python 3.12 on VS Code 2022. I am working with a venv in my current project, and want to install npm into the venv. I first ran the command "pip install nodeenv" in my terminal and it successfully ran and installed nodeenv, and when I run "nodeenv --version" it correctly tells me the version and that it's there. After that I try running "nodeenv -p" which is the next step and supposed to install node.js and npm. However when I run that command I get the following message: "no python virtualenv is available." The full process looks like this:

(.venv) PS C:\Users\stphn\Downloads\Coding_Projects\Azure_Projects> nodeenv --version 1.10.0 (.venv) PS C:\Users\stphn\Downloads\Coding_Projects\Azure_Projects> nodeenv -p >> {'x86': False, 'risc': False, 'lts': False} No python virtualenv is available

I even checked within the scripts folder in my .venv in my file directory, and I can see that the scripts for nodeenv are seemingly properly installed:

picture of my file explorer in project/.venv/Scripts, showing the scripts npm, npm.cmd, npm.ps1, npx, npx.cmd, and npx.ps1 are all there

So I'm very confused as to why "nodeenv -p" is still not working. I deactivated and reactivated my virtual environment and still got the same issue. Any advice would be greatly appreciated!

Stephan Ducrepin's user avatar

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.