ekalinin / nodeenv

Virtual environment for Node.js & integrator with virtualenv
http://ekalinin.github.io/nodeenv/
Other
1.7k stars 212 forks source link

Activate does not work on "fish" shell #262

Open calvinnor opened 4 years ago

calvinnor commented 4 years ago

. env/bin/activate

env/bin/activate (line 74): Unsupported use of '='. In fish, please use 'set SOURCE "${BASH_SOURCE[0]}"'. from sourcing file env/bin/activate called on line 185 of file /usr/share/fish/config.fish in function '.' with arguments 'env/bin/activate' source: Error while reading file “env/bin/activate”

Bruno21 commented 3 years ago

Does not work on "zsh" too.

Seems only work in bash.

ekalinin commented 3 years ago

Does not work on "zsh" too.

Seems only work in bash.

@Bruno21 Could you provide more details, please?

Here's what i got for zsh:

➜ zsh --version
zsh 5.4.2 (x86_64-ubuntu-linux-gnu)

➜ cd /tmp

➜ virtualenv test-nodeenv-env                   

➜ source ./test-nodeenv-env/bin/activate

➜ pip install nodeenv               
Collecting nodeenv
  Downloading nodeenv-1.5.0-py2.py3-none-any.whl (21 kB)
Installing collected packages: nodeenv
Successfully installed nodeenv-1.5.0

➜ nodeenv -p                                           
 * Install prebuilt node (15.1.0) ..... done.
 * Appending data to /tmp/test-nodeenv-env/bin/activate
 * Appending data to /tmp/test-nodeenv-env/bin/activate.fish

➜ deactivate    

➜ source ./test-nodeenv-env/bin/activate

➜ node -v
v15.1.0

➜ whereis node  
node: /usr/bin/node /tmp/test-nodeenv-env/bin/node /usr/share/man/man1/node.1.gz
Bruno21 commented 3 years ago

may be a misunderstanding between activate (python) and activate (nodeenv)

bruno@silverbook: ~/Documents/nodeenv $ bash --version
GNU bash, version 5.0.18(1)-release (x86_64-apple-darwin19.5.0)
bruno@silverbook: ~/Documents/nodeenv $ nodeenv homebridge_in_bash
 * Install prebuilt node (15.1.0) ..... done.
bruno@silverbook: ~/Documents/nodeenv $ . homebridge_in_bash/bin/activate
(homebridge_in_bash) bruno@silverbook: ~/Documents/nodeenv $ node -v
v15.1.0
(homebridge_in_bash) bruno@silverbook: ~/Documents/nodeenv $ deactivate_node

~/Documents/nodeenv master* ⇡
❯ zsh --version
zsh 5.7.1 (x86_64-apple-darwin19.0)

~/Documents/nodeenv master* ⇡
❯ nodeenv homebridge_in_zsh
 * Install prebuilt node (15.1.0) ..... done.

~/Documents/nodeenv master* ⇡ 7s
❯ . homebridge_in_zsh/bin/activate

~/Documents/nodeenv master* ⇡
❯ 
proItheus commented 2 years ago

. env/bin/activate

env/bin/activate (line 74): Unsupported use of '='. In fish, please use 'set SOURCE "${BASH_SOURCE[0]}"'. from sourcing file env/bin/activate called on line 185 of file /usr/share/fish/config.fish in function '.' with arguments 'env/bin/activate' source: Error while reading file “env/bin/activate”

Try . env/bin/activate.fish