Comments (13)
You'd have to enter the subshell and THEN do the thing in there. When you exit, you're not in the subshell any more, and might not even have node (or that version of node) in your PATH any longer. That's why you're getting the node: No such file or directory
error.
Does this do what you want?
./nave.sh use 0.6.5 npm install coffee-script
./nave.sh use 0.6.5 node_modules/.bin/coffee
It wouldn't be too hard to add support for passing more than just one command to the nave use
statement.
from nave.
It does exactly what I want! Thanks for your reply, and sorry for the non-issue.
from nave.
No problem. If you feel that the docs or API could have made this more obvious, a patch would be welcome.
from nave.
Actually, it doesn't do exactly what I want; if I do
$ ./nave.sh use 0.6.5 node_modules/.bin/coffee -cs < test.coffee | head -1
I get
already using 0.6.5
... if I'm already using it; this is a problem for my script that doesn't know whether it is already using it. Can I suppress this message? Shouldn't it go to stderr?
from nave.
Oh, yeah, that's ugly. Should be printing to stderr.
Wanna send a pull req? I think there's an echo_err
function already somewhere.
from nave.
Hm, does it even need to say "already using" when the command is "use"?
from nave.
@welwood08 Well, so that's a bit tricky, actually... Should it create another nested subshell if it's already in a subshell where NAVE=0.6.5? If not, I'd like to have some kind of indication that it's not doing that.
from nave.
Ah yes, nevermind me - I was actually thinking of the "using x" message which seemed a bit verbose when that's what it was instructed to do (at one point I even had the idea to, instead of echoing node version, prefix/modify the shell prompt with it and nave level, but then the sensible, lazy me arrived). Anyway, glad it's going on stderr at least.
from nave.
You mean like this? https://github.com/isaacs/dotfiles/blob/master/.extra.bashrc#L510-522
from nave.
That does indeed look like what I was thinking of but never got round to learning, thanks.
from nave.
I got a new error with the same use case; as of version 2.7, if I do
nave.sh use 0.6.5 node_modules/.bin/coffee
I get in response
Already installed: 0.6.5
using 0.6.5
/usr/bin/env: node: No such file or directory
from nave.
Aha, reproducing. Got a fix, landing now.
from nave.
Ok, fixed on 0.2.10
from nave.
Related Issues (20)
- shasum mismatch HOT 2
- shasum file in cache broken HOT 2
- Use the tab delimited file in the node dist folder instead of parsing html
- How to delete a named environment HOT 2
- How would I use environment variables from the parent shell? HOT 1
- Nave strips off `-n` from arguments
- Auto fails using fish as nave_run executed with exec HOT 1
- macOS install with brew HOT 1
- Named version does not link npx
- Unable to install any node with nave on Windows 10. HOT 1
- unsupported ARM architecture HOT 1
- Fallback to .nvmrc if .naverc isn't specified for nave auto HOT 4
- Q: Can I control where the node versions are installed? HOT 2
- This repository is huge. What is the universal recommended way to install only the files needed to run nave? HOT 2
- Is it possible to define environment variables, or specify a shell script to be sourced, per environment? HOT 12
- Cannot retrieve unmodified argument to `nave use` from environment HOT 8
- Nave caches 500s on index fetch HOT 2
- Clarify that `uninstall` can be used to remove named envs
- lts no longer works as a version HOT 4
- nave install/use version - Fails to install node if user has a shell alias or function called `shasum`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nave.