Ad

Npm Install React-router Missing Examples Folder In Repository?

When running npm install react-router, it installs react-router v1.0.3 which contains an examples folder. However after running

cd node_modules/react-router
ls

the output is

CHANGES.md          README.md           es6                 npm-scripts
CONTRIBUTING.md     SPONSORS.md         lib                 package.json
LICENSE.md          docs                node_modules        umd

It's missing the examples folder! How do I get the examples from npm?

Ad

Answer

You don't.

When packages are distributed through NPM, the developers can choose what gets included. Since packages are intended to be used as dependencies, a lot things are often excluded as unnecessary bulk.

This is controlled by the files property in package.json (and in an .npmignore file). If you look here you can see that they have not included examples in the NPM distribution.

That said, NPM is not a good vehicle for example code, but GitHub is. Why not fetch the examples from there?

Ad
source: stackoverflow.com
Ad