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?
If your npm is broken: On Mac or Linux, reinstall npm. Windows: If you're on Windows and you have a broken installation, the easiest thing to do is to reinstall node from the official installer (see this note about installing the latest stable version).
The npm installation from GitHub is quite useful for testing packages. It also gives the flexibility to install any specific branch, version, tag, and so on.
To Save : npm install --save {package_name} . This will save the package to package. json and install using npm install . You can't particularly control the dependencies(fully).
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With