代码之家  ›  专栏  ›  技术社区  ›  skube

到npm安装库的稍微不同的路径意味着什么?

  •  0
  • skube  · 技术社区  · 5 年前

    我见过两种不同的方法 npm install

    Testing-library.com

    npm install --save-dev @testing-library/react
    

    CSS Tricks tutorial

    npm install --save-dev react-testing-library
    

    我不知道这两条路有什么区别?

    :我刚找到一个 issue regarding this specific library :

    ¨ react测试库已移动到@testing library/react。拜托 卸载react testing library并安装@testing library/react 或者使用旧版本的react测试库。了解更多 https://github.com/testing-library/dom-testing-library/issues/260 谢谢!:)

    1 回复  |  直到 5 年前
        1
  •  3
  •   rakesh-ranjan    5 年前

    第一个命令是安装范围包的示例。在这里, @testing-library react . 使用作用域是可选的,如果不使用(如在第二个命令中),它将从默认作用域(主要是github)获取它。

    有关更多详细信息,请参阅 npm-scope https://docs.npmjs.com/misc/scope