React Native: npm link local dependency, unable to resolve module

后端 未结 8 1382
不知归路
不知归路 2020-12-23 02:14

I am developing a button ui package for react native. I try to build an example project to test this button. The directory structure is as follows:

my-button         


        
8条回答
  •  有刺的猬
    2020-12-23 02:36

    Ran into the same problem. While I could not make npm link work as it should, I worked around it by installing the local package in the project folder

    npm install ../ --save
    

    This will install the package like a regular package but from the local folder. The downside is that the changes you make on the package will not be reflected. You will have to npm install after every change.

提交回复
热议问题