简体   繁体   English

将package.json指向特定的React提交会安装react-tools(not react)

[英]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 reactnpm 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.

相关问题 Heroku 没有为 react package.json 获取 PORT - Heroku is not getting PORT for react package.json 基本的JSPM React样本在加载react-tools / vendor / fbtransform / visitors时失败错误 - basic JSPM React sample failing erroring on loading react-tools/vendor/fbtransform/visitors package.json 中的自定义反应脚本无法识别 - Custom react script in package.json is not recognised 在Windows上,package.json中的React Create App Proxy Agent在Windows上运行缓慢 - React create app proxy agent in package.json is slow on Windows 如何从 package.json 设置 NODE_ENV 以进行反应 - How to set NODE_ENV from package.json for react package.json 依赖问题? - “未捕获的 ReferenceError:未定义反应” - package.json dependency issue? - “Uncaught ReferenceError: react is not defined” 无法在 React 中使用 package.json“导出”导入模块 - Can't import module using package.json "exports" in React 无法在package.json中正确指向start标记以反应js - Not able to point the start tag correctly in package.json for react js React Js:没有那个文件或目录,打开Package.json - React Js : no such file or directory, open Package.json 在反应应用程序中将 package.json 上移一个目录 - Move package.json up one dirctory in react app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM