[CLI] Publish library via NPM needs change in Header Search Paths
See original GitHub issueIf you create a library with react-native new-library [...]
and publish it via NPM you could get an error, like RCTViewManager.h file not found
after installing via npm install
. This error just occurs, if you put your files in an additional subfolder, like /lib
for example:
index.js
lib/[filename].xcodeproj
lib/[filename].h
...
To solve the error you need to add the Header Search Path $(SRCROOT)/../../react-native/React
to the library.
I don’t know if this is path should get added always automatically, since this filestructure is pretty common, or just mentioned in the docs.
Issue Analytics
- State:
- Created 8 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
npm-publish - npm Docs
Publishes a package to the registry so that it can be installed by name. By default npm will publish to the public registry....
Read more >config - npm Docs
Run npm config ls -l to see a set of configuration parameters that are internal to npm, and are defaults if nothing else...
Read more >config | npm Docs
Run npm config ls -l to see a set of configuration parameters that are internal to npm, and are defaults if nothing else...
Read more >package.json - npm Docs
Changes to the package should come along with changes to the version. If you don't plan to publish your package, the name and...
Read more >npm-publish | npm Docs
By default npm will publish to the public registry. This can be overridden by specifying a different default registry or using a scope...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Purii I wouldn’t disagree that the Headers Search Path causes every newcomer confusion. I think a blurb in the docs is warranted. I’ll toss it on my list and see if I can cobble something together that hints people in the right direction…
@joshuapinter I pulled back my PR #2315 for the reason I wrote above.
Adding the headers search paths to support a library structure like /lib/ wouldn’t solve issues with a structure like /lib/src/ and so on. I am of the opinion, that this depends on the author of every lib. Maybe a mention in the docs?