zoukankan      html  css  js  c++  java
  • 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/ 本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接。
  • 相关阅读:
    有关javamelody的配置
    jsp页面路径问题
    mavne问题解决---Dynamic Web Module 2.3 or newer
    centos配置数据源和java环境配置
    iBatis之Iterator的使用
    [转]Android MediaPlayer状态机
    [转]Android Activity的加载模式和onActivityResult方法之间的冲突
    ubuntu1304无法启动桌面系统的问题和解决
    java使用AES256解密
    [转]理解Linux的处理器负载均值
  • 原文地址:https://www.cnblogs.com/lightsong/p/14779869.html
Copyright © 2011-2022 走看看