【问题标题】:node_modules developing dependency packagenode_modules 开发依赖包
【发布时间】:2021-10-24 05:57:46
【问题描述】:

我正在研究一个有一些依赖关系的应用程序。我想在本地对一个依赖项进行一些更改。

我尝试在主应用程序的 node_modules 中创建一个指向依赖文件夹的符号链接,其中我使用此命令ln -s dependency_folder main_app/node_modules/dependecy 拥有带有编译代码(es 和 lib)的文件夹。

它不起作用并引发错误:

Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:

1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://reactjs.org/warnings/invalid-hook-call-warning.html for tips about how to debug and fix this problem.

这是开发依赖包的正确方法,还是我做错了。

【问题讨论】:

    标签: node.js reactjs hyperlink node-modules package.json


    【解决方案1】:

    我意识到链接到依赖包没有问题。这里发生的是项目源文件已过期。编译的依赖在 NPM 上是最新的,在 git 上源是过时的。

    我将留下此消息以作记录。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-09-08
      • 2020-08-07
      • 2020-02-24
      • 2018-06-25
      • 2020-03-24
      • 1970-01-01
      • 2017-02-03
      • 1970-01-01
      相关资源
      最近更新 更多