Pointing package.json to a specific React commit installs react-tools (not react)

201 views Asked by At

When I add this line to my package.json:

"react": "git://github.com/facebook/react.git#08e4420019f74b7c93e64f59c443970359102530"

...and then run npm install, I find node_modules/react-tools installed when I expect to see node_modules/react.

What am I doing wrong here?

1

There are 1 answers

0
Michelle Tilley On

The code at git://github.com/facebook/react.git is not the same code that gets installed when you npm install react. Instead, the code contains a series of build steps that are used to build the npm package. As far as I know, there is not a way to easily use a specific SHA of the React repo as an npm package; you would need to clone the repo, build the project, and copy it somewhere you can require it.