V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
treblex
V2EX  ›  macOS

macos 使用 n 切换版本的使用很慢,用 rust 做了个小工具,创建临时的 nodejs 环境,需要配合 n 使用

  •  
  •   treblex · 116 天前 · 519 次点击
    这是一个创建于 116 天前的主题,其中的信息可能已经有所发展或是发生改变。

    github https://github.com/LazyFury/node_version

    npm https://www.npmjs.com/package/@sukeai/node_version

    最近写了点 python ,pipenv 和 poetry 的感觉挺好的

    照猫画虎做了个类似的小工具

    只支持两个命令,不会做 pipenv shell 的效果😭,不过暂时够用

    node_version -v 16.18 --run "node -v"
    
    node_version gen -v 16.18 -o "env.sh"
    
    coolcoffee
        1
    coolcoffee  
       115 天前
    fnm 好像可以识别目录下的.node-version 或者.nvmrc ,然后自动加载对应的版本。同样是 rust 写的。😂

    https://github.com/Schniz/fnm
    treblex
        3
    treblex  
    OP
       115 天前
    @coolcoffee 早知道我就不折腾了哈哈
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2827 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 14:57 · PVG 22:57 · LAX 07:57 · JFK 10:57
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.