[英]Pointing package.json to a specific React commit installs react-tools (not react)
When I add this line to my package.json: 当我将此行添加到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
. ...然后运行npm install
,当我希望看到node_modules/react
时,我发现npm install
node_modules/react-tools
。
What am I doing wrong here? 我在这里做错了什么?
The code at git://github.com/facebook/react.git
is not the same code that gets installed when you npm install react
. git://github.com/facebook/react.git
上的代码与npm install react
时npm install react
代码不同。 Instead, the code contains a series of build steps that are used to build the npm package. 相反,该代码包含一系列用于构建npm软件包的构建步骤 。 As far as I know, there is not a way to easily use a specific SHA of the React repo as an npm package; 据我所知,还没有一种方法可以轻松地将React repo的特定SHA用作npm包。 you would need to clone the repo, build the project, and copy it somewhere you can require
it. 您将需要克隆存储库,构建项目并将其复制到require
地方。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.