Comments (8)
Why
Only because I did not know that was possible! 😄
The spec should be modified to allow that and any other intentionally allowed version specifiers.
from nvm.
My hunch as someone who's never contributed to this repository or thought deeply about the space (😄) is that something short and to the point would work, provided it explicitly calls out what areas aren't yet solidified.
Using RFC 2199's nomenclature:
.nvmrc
files MUST contain an npm-style semver version string, such as1
,1.2
, or1.2.3
. This version string MUST be the first set of characters in the file, excluding an optionalv
..nvmrc
files MAY prefix their version string with av
..nvmrc
files MAY include a blank line after the version string..nvmrc
files SHOULD NOT include trailing whitespace around the version string. Doing so is undefined behavior not covered by this specification..nvmrc
files SHOULD NOT include additional lines after the version string. Doing so is undefined behavior not covered by this specification.
...I've never written a technical spec for a file format or syntax before. 🙂
from nvm.
Makes sense. I'll give it a shot over the next week or two, and will probably also ship an npm package to validate the file.
from nvm.
No, there’s no spec (just current behavior) and writing one without extreme care would preclude future enhancements, so I’m hesitant.
The next version of nvm will ignore trailing lines (ie, only regard the first line) but I’d like to extend it in the future so it can contain additional information.
The first line can contain any “version-ish”, iow, anything nvm use
or nvm install
or nvm exec
etc will accept, which is much wider than “node -v”.
from nvm.
I suppose it's worth writing something up just do nobody does it wrong :-) for example anything that claims to support nvmrc but only supports version numbers, doesn't support nvmrc.
I have no idea what that kind of spec would look like, though. Any thoughts?
from nvm.
My hunch as someone who's never contributed to this repository or thought deeply about the space (😄) is that something short and to the point would work, provided it explicitly calls out what areas aren't yet solidified.
Using RFC 2199's nomenclature:
* `.nvmrc` files _MUST_ contain an npm-style semver version string, such as `1`, `1.2`, or `1.2.3`. This version string _MUST_ be the first set of characters in the file, excluding an optional `v`. * `.nvmrc` files _MAY_ prefix their version string with a `v`. * `.nvmrc` files _MAY_ include a blank line after the version string. * `.nvmrc` files _SHOULD NOT_ include trailing whitespace around the version string. Doing so is undefined behavior not covered by this specification. * `.nvmrc` files _SHOULD NOT_ include additional lines after the version string. Doing so is undefined behavior not covered by this specification.
...I've never written a technical spec for a file format or syntax before. 🙂
Why would i be disallowed to use
lts/iron
in .nvmrc?
It is a valid version what nvm ls-remote
gives me, and it works without pain.
from nvm.
That's great.
BTW my apologies for butting into this discussion.
I would suspect the code of nvm ls-remote
and the code which reads out .nvmrc use the same tokenizer to enumerate the version already? At least that would be possible with this spec.
from nvm.
Yes, i would make sure anything nvm supports is allowed, which includes custom aliases.
from nvm.
Related Issues (20)
- `nvm install 14` compile fails HOT 2
- Installation : The term 'bash' is not recognized as the name HOT 7
- Installation Error: Invoke-WebRequest : A parameter cannot be found that matches parameter name 'o-' HOT 2
- Feature Request: General Name for Install Script HOT 2
- nvm ls-remote returns N/A HOT 4
- NVM just will not change version of node HOT 8
- Problems installing/using nvm in AppCenter HOT 2
- Long loading times fixed by better design HOT 1
- [spam]
- NVM problem with corepack and yarn HOT 1
- Curl Error HOT 9
- Error, parse error near `do' when trying to install MacOS HOT 2
- Error when using fetch/axios/node-fetch HOT 1
- curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash timing Out HOT 3
- [spam]
- `lts/` aliases change with new releases rather than finding the highest local match HOT 3
- Failed to checkout the given version $NVM_VERSION HOT 1
- Allow comments in .nvmrc config file HOT 5
- macOS when install 14 curl: (22) The requested URL returned error: 404 HOT 1
- macOS curl: (22) The requested URL returned error: 404 HOT 1
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 nvm.