【发布时间】:2018-05-24 12:59:29
【问题描述】:
G'day。我一直在研究一个新的大型应用程序大约一年。在工作过程中,我一直在使用两台相同的机器,一台在工作,一台在办公室。源通过 github 共享。家里的机器与 git 同步,工作的机器做了很多繁重的工作。由于错误和在 Google 上的搜索,我得到的建议(而且似乎很合理)重新安装 React 的供应商开发端,由
rm -rf node_modules
npm install
应用程序陷入尖叫堆,我认为它没有运行的机会!文件 package.json 在一台机器上与另一台机器上是相同的,但是,在仅一台机器上运行 npm install 后,node_modules 中有 4435 个文件不同!
对于版本控制和软件安全来说,这是一场噩梦。包文件不是我手工构建的,npm是在“啊,我需要那个”的过程中做的
npm install redux-form --save
包文件。
{
"name": "asset_intel",
"version": "1.0.0",
"description": "Application re-write for Asset-IQ Dealer network",
"main": "index.js",
"repository": "",
"scripts": {
"start": "webpack-dev-server",
"build": "webpack --config webpack.config.js"
},
"author": "Mark Addinall",
"license": "ISC",
"devDependencies": {
"babel-core": "^6.2.1",
"babel-loader": "^6.2.0",
"babel-polyfill": "^6.23.0",
"babel-preset-es2015": "^6.1.18",
"babel-preset-react": "^6.1.18",
"chai": "^3.5.0",
"chai-jquery": "^2.0.0",
"jquery": "^2.2.1",
"jsdom": "^8.1.0",
"mocha": "^2.4.5",
"react-addons-test-utils": "^0.14.7",
"webpack": "^3.1.0",
"webpack-dev-server": "^2.5.0"
},
"dependencies": {
"axios": "^0.15.3",
"babel-polyfill": "^6.23.0",
"babel-preset-stage-1": "^6.1.18",
"css-loader": "^0.28.4",
"file-loader": "^0.11.2",
"lodash": "^3.10.1",
"prop-types": "^15.5.10",
"react": "^0.14.9",
"react-addons-update": "^15.5.2",
"react-autosuggest": "^9.0.1",
"react-bootstrap": "^0.31.0",
"react-bootstrap-autosuggest": "^0.5.0",
"react-dnd": "^2.4.0",
"react-dnd-html5-backend": "^2.4.1",
"react-dom": "^0.14.9",
"react-dropzone": "^3.13.2",
"react-hot-loader": "^1.3.1",
"react-images-uploader": "^1.0.1",
"react-redux": "^4.0.0",
"react-redux-modal": "^0.5.2",
"react-router": "^2.8.1",
"react-sparklines": "^1.6.0",
"react-widgets": "^3.4.8",
"redux": "^3.0.4",
"redux-accordion": "^1.0.721",
"redux-ajax": "^1.0.5",
"redux-form": "^6.5.0",
"redux-promise": "^0.5.3",
"redux-tooltip": "^0.7.2",
"style-loader": "^0.16.1",
"youtube-api-search": "0.0.5"
}
}
不是很复杂。我决定将工作的 node_modules 粘贴到 git 中,我想我会将版本粘贴在 package.json 中。
其他人如何在复杂的应用程序中管理此控件?
干杯, 标记。
【问题讨论】:
标签: node.js git reactjs react-redux node-modules