nodeenv p没有在virtualen中工作

2024-04-23 11:29:02 发布

您现在位置:Python中文网/ 问答频道 /正文

我已成功安装pyenv并创建了一个虚拟环境:

$ pyenv virtualenv 3.6.3 venv
$ pyenv activate venv
$ pip install -r requirements.txt

前面的所有操作都允许在带有Ubuntu的windows10linux子系统中成功地安装nodeenv。在

然后,我按照在Internet上找到的一些说明正确安装nodeenv安装程序:

^{pr2}$

假设nodeenv -pnodeenv virtualenv与{}绑定。这在我的工作笔记本电脑上有效,但在我的个人笔记本电脑上停止工作。事件顺序如下:

$ pyenv activate server363
$ pyenv-virtualenv: prompt changing will be removed from future release. configure 'export PYENV_VIRTUALENV_DISABLE_PROMPT=1' to simulate the behavior.
$ nodeenv -p
 * Install prebuilt node (9.11.1) ..... done.
 * appending data to /home/fbenavides/.pyenv/versions/3.6.3/envs/server363/bin/activate
$ node -v
The program 'node' can be found in the following packages:
 * node
 * nodejs-legacy
Try: sudo apt-get install <selected package>
$ node -V
The program 'node' can be found in the following packages:
 * node
 * nodejs-legacy
Try: sudo apt-get install <selected package>
$ nodejs -v
The program 'nodejs' is currently not installed. You can install it by typing:
sudo apt-get install nodejs
$ nodejs -V
The program 'nodejs' is currently not installed. You can install it by typing:
sudo apt-get install nodejs
$ nodeenv -v
Usage: nodeenv [OPTIONS] ENV_DIR

nodeenv: error: You must provide a DEST_DIR or use current python virtualenv
$ nodeenv -V
Usage: nodeenv [OPTIONS] ENV_DIR

nodeenv: error: no such option: -V

我错过什么了吗?在


Tags: installthenodepyenvgetvirtualenvnodejssudo
1条回答
网友
1楼 · 发布于 2024-04-23 11:29:02

Windows 10 Linux子系统Ubuntu安装使用.bashrc文件来存储pyenv和{}设置,为了使nodeenv -p命令有效地安装节点服务器并将其绑定到pyenv virtualenv设置:

export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"

相关问题 更多 >