npm WARN该软件包作为dev和生产依赖项包含在内
运行npm install
我得到了这些警告:
npm WARN The package babel-core is included as both a dev and production dependency. npm WARN The package babel-loader is included as both a dev and production dependency. npm WARN The package babel-preset-react is included as both a dev and production dependency. npm WARN The package redux-thunk is included as both a dev and production dependency. npm WARN The package uglifyjs is included as both a dev and production dependency. up to date in 7.183s npm WARN The package babel-core is included as both a dev and production dependency. npm WARN The package babel-loader is included as both a dev and production dependency. npm WARN The package babel-preset-react is included as both a dev and production dependency. npm WARN The package redux-thunk is included as both a dev and production dependency. npm WARN The package uglifyjs is included as both a dev and production dependency.
package.json
文件:
{ ... "dependencies": { "axios": "^0.15.3", "babel-core": "^6.10.4", "babel-loader": "^6.2.4", "babel-polyfill": "^6.9.1", "babel-preset-es2015": "^6.9.0", "babel-preset-react": "^6.11.1", "babel-preset-stage-2": "^6.24.1", "babel-register": "^6.9.0", "bluebird": "^3.5.0", "bootstrap-sass": "^3.3.7", "classnames": "^2.2.5", "console-polyfill": "^0.2.3", "cross-env": "^1.0.8", "css-loader": "^0.23.1", "deepmerge": "^1.3.2", "dom-helpers": "^3.0.0", "expect": "^1.20.1", "fuzzy": "^0.1.3", "moment": "^2.18.1", "node-libs-browser": "^1.0.0", "node-sass": "^3.8.0", "react": "^15.1.0", "react-addons-shallow-compare": "15.4.0", "react-addons-test-utils": "^15.1.0", "react-axios": "0.0.9", "react-bootstrap-daterangepicker": "^3.2.2", "react-daterange-picker": "^1.1.0", "react-dom": "^15.1.0", "react-draggable": "^2.2.3", "react-redux": "^4.4.8", "react-router": "^3.0.2", "react-virtualized": "^8.5.2", "redux": "^3.6.0", "redux-logger": "^2.6.1", "redux-promise": "^0.5.3", "redux-promise-middleware": "^4.2.0", "redux-thunk": "^2.1.0", "sass-loader": "^4.0.0", "style-loader": "^0.13.1", "uglifyjs": "=2.4.10", "webpack-dev-middleware": "^1.6.1", "webpack-dev-server": "^1.14.1", "webpack-hot-middleware": "^2.11.0" }, "devDependencies": { "assets-webpack-plugin": "^3.5.1", "babel-core": "^6.24.1", "babel-loader": "^7.0.0", "babel-plugin-add-module-exports": "^0.2.1", "babel-plugin-react-transform": "^2.0.2", "babel-plugin-transform-decorators-legacy": "^1.3.4", "babel-preset-es2016": "^6.24.1", "babel-preset-react": "^6.24.1", "babel-preset-stage-3": "^6.24.1", "didyoumean": "^1.2.1", "extract-text-webpack-plugin": "^1.0.1", "glob": "^7.1.1", "postcss-loader": "^1.3.0", "purifycss-webpack-plugin": "^2.0.3", "react-transform-hmr": "^1.0.4", "redux-thunk": "^2.2.0", "uglifyjs": "=2.4.10", "webpack": "^1.15.0", "webpack-cleanup-plugin": "^0.5.1", "webpack-split-chunks": "^0.1.1" } }
注意到有不同的版本安装。 当dev和prod安装了同一个软件包的两个版本时会发生什么? 这是正常的行为? 我应该摆脱package.json文件中的引用?
你有你的依赖关系的两个部分引用的包; 你应该完全不这样做,因为这意味着你的生产安装将有一个不同的版本到你的开发安装。
如果你做npm install
你会得到所有dependencies
和devDependencies
安装; 但是,如果您执行npm install --production
,则只会安装dependencies
。
您应该删除不需要的应用程序以从dependencies
运行,并将它们放在devDependencies
。 dependencies
东西应该被视为运行应用程序的要求(发生任何代码转换之后)。
在两个情况下,依赖关系都是零的情况。
- NPM模块需要从/ Users / node_modules /而不是项目目录
- 为什么不在db.collection()中callback?find()。toArray(callback)在数据库连接被删除的情况下调用?
- 使用Node.JS,MongoDB和Socket.IO的实时多人游戏:游戏循环和asynchronous调用
- 是否有可能在nodejs中实现multithreading?
- 用于asynchronousLinux脚本的Node.js
- 有错误,而试图运行在一边g喝
- 在Javascript逻辑中访问EJSvariables
- 节点快递护照(JWT) – auth后callback
- 工头在Node.js中启动时出错