• Node多版本管理


    引子

    运行一个react程序,报类似如下的错误。

    使用如下搜索链接,

    https://www.bing.com/search?q=unexpected+token+catch&FORM=R5FD1

    官网有类似问题

    https://github.com/facebook/jest/issues/10170

    原因是

    Jest 26 doesn't support node 8, you need to use node 10+

    需求

    Node版本迭代很快,不同应用依赖不同的版本,在同一环境下往往需要频繁切换node版本。

    在python环境下有 pyenv 来帮助,在node环境下有没有相类似的包管理工具呢?

    方案

    https://stackoverflow.com/questions/50399621/multiple-versions-of-node-on-windows

    This is achievable via various version managers.

    For Windows, take a look at NVM for Windows.

    For macOS or Linux (not your OS, I see, but for others reading), I like n, and NVM is also widely used.

    nvm-windows

    https://github.com/coreybutler/nvm-windows

    Node Version Manager (nvm) for Windows

    nvm-windows let's you do that. Before installing nvm-windows, please uninstall all Node versions from your computer.

    To install any Node version, type in command prompt nvm install [node version], like for example:

    • nvm install 10.16.0
    • nvm install 6.11.0

    nvm list lists all Node versions you installed:

    • 10.16.0
    • 6.11.0

    n – Interactively Manage Your Node.js Versions

    https://github.com/tj/n

    Node.js version management: no subshells, no profile setup, no convoluted API, just simple.

    usage animation

    https://blog.csdn.net/skylark0924/article/details/79306999

    Node Version Manager

    https://github.com/nvm-sh/nvm

    About

    nvm is a version manager for node.js, designed to be installed per-user, and invoked per-shell. nvm works on any POSIX-compliant shell (sh, dash, ksh, zsh, bash), in particular on these platforms: unix, macOS, and windows WSL.

    出处:http://www.cnblogs.com/lightsong/ 本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接。
  • 相关阅读:
    Python
    Ext.js入门:TreePanel(九)
    Ext.js入门:TabPanel组件(八)
    Asp.NetMVC和WebForm的请求生命周期
    C#4.0特性
    LINQ学习之旅(三)
    Ext.js入门:常用组件与综合案例(七)
    Ext.js入门:Window对象与FormPanel(六)
    Ext.js入门:面板(五)
    Ext.js入门:模板(四)
  • 原文地址:https://www.cnblogs.com/lightsong/p/14779869.html
Copyright © 2020-2023  润新知