question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[CLI] Publish library via NPM needs change in Header Search Paths

See original GitHub issue

If 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 /libfor 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:closed
  • Created 8 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
joshuapintercommented, Mar 29, 2016

@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…

0reactions
Puriicommented, Mar 24, 2016

@joshuapinter I pulled back my PR #2315 for the reason I wrote above.

this is issue is more related to certain libraries than to react-native

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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found