V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
treblex
V2EX  ›  macOS

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

  •  
  •   treblex · Jan 2, 2024 · 1526 views
    This topic created in 848 days ago, the information mentioned may be changed or developed.

    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  
       Jan 3, 2024
    fnm 好像可以识别目录下的.node-version 或者.nvmrc ,然后自动加载对应的版本。同样是 rust 写的。😂

    https://github.com/Schniz/fnm
    treblex
        3
    treblex  
    OP
       Jan 3, 2024
    @coolcoffee 早知道我就不折腾了哈哈
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5095 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 58ms · UTC 08:18 · PVG 16:18 · LAX 01:18 · JFK 04:18
    ♥ Do have faith in what you're doing.