npm install slow

(Dan Oprita) #1

I have a create react app project with additional dependencies needed for my project.

This is my package.json:
“name”: “my-app”,
“version”: “0.1.0”,
“private”: true,
“dependencies”: {
“auth0-js”: “^9.0.0”,
“enzyme”: “^3.2.0”,
“enzyme-adapter-react-16”: “^1.1.0”,
“es6-promise”: “^4.2.4”,
“isomorphic-fetch”: “^2.2.1”,
“jquery”: “^3.2.1”,
“node-sass-chokidar”: “0.0.3”,
“npm-run-all”: “^4.1.2”,
“query-string”: “^5.1.0”,
“react”: “^16.2.0”,
“react-bootstrap”: “^0.31.5”,
“react-bootstrap-select”: “^0.14.0”,
“react-dom”: “^16.2.0”,
“react-dropzone”: “^4.2.7”,
“react-redux”: “^5.0.7”,
“react-router”: “^4.1.1”,
“react-router-dom”: “^4.1.1”,
“react-scripts”: “1.0.17”,
“react-select”: “^1.1.0”,
“react-test-renderer”: “^16.2.0”,
“redux”: “^4.0.0”,
“redux-form”: “^7.4.2”,
“redux-thunk”: “^2.2.0”,
“superagent”: “^3.8.2”
“scripts”: {
“start-js”: “react-scripts start”,
“start”: “npm-run-all -p watch-css start-js”,
“build-js”: “react-scripts build”,
“build”: “npm-run-all build-css build-js”,
“test”: “run-s -n test-js”,
“test-js”: “react-scripts test --env=jsdom”,
“test-with-coverage”: “react-scripts test --env=jsdom --coverage”,
“build-css”: “node-sass-chokidar --include-path ./src --include-path ./node_modules src/ -o src/”,
“watch-css”: “npm run build-css && node-sass-chokidar --include-path ./src --include-path ./node_modules src/ -o src/ --watch --recursive”,
“storybook”: “start-storybook -p 9009 -s public”,
“build-storybook”: “build-storybook -s public”
“devDependencies”: {
@storybook/addon-actions”: “^3.2.17”,
@storybook/addon-links”: “^3.2.17”,
@storybook/react”: “^3.2.17”,
“babel-preset-es2015”: “^6.24.1”,
“babel-preset-react”: “^6.24.1”,
“bootstrap”: “^3.3.7”,
“bootstrap-sass”: “^3.3.7”,
“storybook-react-router”: “^1.0.1”
“jest”: {
“collectCoverageFrom”: [

“homepage”: “./”,
“proxy”: “http://localhost:8080

npm install takes between 6 - 10 minutes

  1. Is it a normal duration for npm install and my given package.json?
    For me it seems to be a little bit too much for a simple UI project.

  2. In order to see if there are differences I ran npm install with different setups/configurations as follows:
    a. remove ~/.npm directory, remove ./node_modules, run npm install
    Run time: 9m19.950s

    b. keep ~/.npm directory, remove ./node_modules, run npm install
    Run time: 9m17.491s

  3. I also configured a nexus npm proxy registry but no improvements

  4. I also installed locally npm-local registry but no improvements

I would like to understand better npm’s caching mechanism, related to:
~/.npm directory
npm proxy registry
How they related to each other, what are the best configuratoins.

Is it normal to obtain the times specified below? Or I’m doing something wrong?


(system) #2

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.