I was wondering if it is possible to do a single installation of node packages that can then be accessed by different development applications. For example, whenever I'm working on a react app, I do npm install to get all node packages the app needs. However, it seems that this gets a lot of unneeded extras. Is there a way
- to just get what my app needs as specified in the package file or
- get everything into the node modules folder in the installation folder and access the packages from there without having to reinstall them locally in every app folder.
I'm adding the following since my question is not being answered:
Let's say I have the following package.json. If I navigate to my app folder where this package.json file is located and I do npm install
, what gets installed and where? My assumption is that only the packages listed in devDependencies and in dependencies will be installed and that it will be installed locally since I did not specify global. So why do I see hundreds of other packages (packages not in the list below) when I go into my node_modules folder in my app?
what I would like is to install only the packages listed below and to make them global so that if I go into another app directory I do not have to reinstall these.
{
"devDependencies": {
"babel-eslint": "7.1.1",
"babel-jest": "18.0.0",
"concurrently": "3.1.0",
"enzyme": "2.7.1",
"eslint": "3.12.1",
"eslint-config-defaults": "9.0.0",
"eslint-plugin-react": "6.7.1",
"jest": "18.1.0",
"json-server": "0.9.4",
"react-addons-test-utils": "15.4.2",
"react-test-renderer": "15.4.2",
"rimraf": "2.5.4",
"sass-lint": "1.10.2",
"tslint": "4.3.1",
"webpack-dev-server": "2.6.1"
},
"dependencies": {
"bootstrap": "4.0.0-alpha.6",
"bootstrap-loader": "2.0.0-beta.20",
"copy-webpack-plugin": "4.0.1",
"css-loader": "0.26.1",
"empty": "0.10.1",
"extract-text-webpack-plugin": "2.0.0-rc.3",
"file-loader": "0.10.0",
"html-loader": "0.4.3",
"html-webpack-plugin": "2.26.0",
"key-mirror": "1.0.1",
"lodash": "4.16.2",
"node-sass": "4.5.0",
"null-loader": "0.1.1",
"postcss": "5.2.9",
"postcss-import": "9.1.0",
"postcss-loader": "1.2.1",
"raw-loader": "0.5.1",
"react": "15.4.2",
"react-addons-css-transition-group": "15.4.2",
"react-dom": "15.4.2",
"react-redux": "5.0.2",
"react-router": "3.0.0",
"react-router-redux": "4.0.7",
"redux": "3.6.0",
"redux-thunk": "2.1.0",
"resolve-url-loader": "1.6.1",
"sass-loader": "5.0.1",
"style-loader": "0.13.1",
"ts-loader": "1.3.3",
"typescript": "2.1.4",
"url-loader": "0.5.7",
"webpack": "2.2.1",
"whatwg-fetch": "2.0.3"
},
}