Reputation: 12177
I am using working from this github issue and it says to use a temporary github fork until a pull request is merged in another repo....cool.
I try to add the github fork to my project dependencies by doing this...
"reactstrap": "git+https://github.com/jameswomack/reactstrap.git",
in the package.json
file and when I do a npm install
everything goes according to plan, but then I get failures with my project not being able to find reactstrap
...
When I go to inspect my node_modules
I can see that the reactrap directory is pretty empty with only the LICENSE
, README
and package.json
files...
What am I missing here?
Upvotes: 9
Views: 2352
Reputation: 20236
The package.json file of the repository contains these lines:
"files": [
"LICENSE",
"README.md",
"CHANGELOG.md",
"lib",
"dist"
]
This is the list of files and directories to include in the npm package. As you can see, the actual JavaScript files will be located in the lib
and dist
directories.
The problem is that these directories are not checked into the Git repository, but created by a build, when you run npm run build
.
A workaround that I would try: run the build, commit and push the generated files to your fork on GitHub. After that, installing the dependency the way you do it should give you the desired result.
However, if your goal is simply to test if your changes on a local fork of reactstrap
work by including it as a dependency of a demo project, there is a better way: use npm link.
It works like this:
reactstrap
fork, execute the command npm link
reactstrap
as dependency, execute the command npm link reactstrap
Any changes you then do to your reactstrap
fork will be available in your demo project immediately.
Upvotes: 13