Home > Enterprise >  Why doesn't npm update ever seem to do anything for me?
Why doesn't npm update ever seem to do anything for me?

Time:11-15

I've read through what seems like dozens of SO questions from people saying npm update doesn't do anything for them. I'm in the same boat, but none of the solutions works for me, and this happens to me all the time. It simply doesn't do a thing.

Right now in particular I'm trying to just update @chakra-ui/react from my currently installed version to the latest version. I tried npm update (to hopefully update everything, including this package), but that didn't do a thing. So then I tried npm update @chakra-ui/react which similarly did not a thing. Adding -dd to either command just prints mostly a bunch of 'timing' messages, and nothing all that particularly useful that I can see.

Here are some details etc:

  • from what I understand, having ^ in front of my version number in package.json means it will update from let's say 2.0.0 up to 2.99999999.9999999 for example. But it won't ever update to 3.0.0.
  • my package.json for @chakra-ui/react is "^2.2.1" and the latest version on NPM is 2.3.7, so this should get updated right?

Here's the package.json and npm update -dd output..

Can anyone see what I'm missing? [rant]This is so frustrating, it always happens to me, and I always have to uninstall / reinstall whatever package(s) I'm trying to update.[/rant]

package.json:

{
"name": "app",
"version": "0.1.0",
"private": true,
"homepage": "....",
"dependencies": {
    "@bugsnag/js": "^7.18.0",
    "@bugsnag/plugin-react": "^7.18.0",
    "@chakra-ui/react": "^2.2.1",
    "@emotion/react": "^11.9.3",
    "@emotion/styled": "^11.9.3",
    "@reduxjs/toolkit": "^1.8.3",
    "@sentry/react": "^7.17.3",
    "@sentry/tracing": "^7.17.3",
    "@testing-library/jest-dom": "^5.16.4",
    "@testing-library/react": "^13.3.0",
    "@testing-library/user-event": "^14.2.1",
    "axios": "^0.27.2",
    "chakra-ui-autocomplete": "^1.4.5",
    "circletype": "^2.3.0",
    "framer-motion": "^6.5.0",
    "html2canvas": "^1.4.1",
    "lodash": "^4.17.21",
    "react": "^18.2.0",
    "react-date-picker": "^9.0.0",
    "react-datepicker": "^4.8.0",
    "react-dom": "^18.2.0",
    "react-easy-crop": "^4.4.2",
    "react-icons": "^4.4.0",
    "react-image-crop": "^10.0.5",
    "react-intersection-observer": "^9.3.5",
    "react-redux": "^8.0.2",
    "react-router": "^6.3.0",
    "react-router-dom": "^6.3.0",
    "react-scripts": "^5.0.1",
    "react-select": "^5.4.0",
    "react-use-hoverintent": "^1.2.7",
    "react-window": "^1.8.7",
    "sass": "^1.53.0",
    "store": "^2.0.12",
    "web-vitals": "^2.1.4"
},
"scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
},
"eslintConfig": {
    "extends": "react-app"
},
"browserslist": {
    "production": [
        ">0.2%",
        "not dead",
        "not op_mini all"
    ],
    "development": [
        "last 1 chrome version",
        "last 1 firefox version",
        "last 1 safari version"
    ]
}
}

output:

npm : npm verb cli [
At line:1 char:1
  npm update @chakra-ui/react --dd >> output.txt 2> output2.txt
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      CategoryInfo          : NotSpecified: (npm verb cli [:String) [], RemoteException
      FullyQualifiedErrorId : NativeCommandError

npm verb cli   'C:\\Program Files\\nodejs\\node.exe',
npm verb cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
npm verb cli   'update',
npm verb cli   '@chakra-ui/react',
npm verb cli   '--dd'
npm verb cli ]
npm info using [email protected]
npm info using [email protected]
npm timing npm:load:whichnode Completed in 0ms
npm timing config:load:defaults Completed in 2ms
npm timing config:load:file:C:\Program Files\nodejs\node_modules\npm\npmrc Completed in 2ms
npm timing config:load:builtin Completed in 3ms
npm timing config:load:cli Completed in 2ms
npm timing config:load:env Completed in 0ms
npm timing config:load:file:D:\.........\.npmrc Completed in 0ms
npm timing config:load:project Completed in 3ms
npm timing config:load:file:C:\Users\Mike W\.npmrc Completed in 0ms
npm timing config:load:user Completed in 0ms
npm timing config:load:file:C:\Users\Mike W\AppData\Roaming\npm\etc\npmrc Completed in 1ms
npm timing config:load:global Completed in 1ms
npm timing config:load:validate Completed in 0ms
npm timing config:load:credentials Completed in 1ms
npm timing config:load:setEnvs Completed in 1ms
npm timing config:load Completed in 15ms
npm timing npm:load:configload Completed in 15ms
npm timing npm:load:setTitle Completed in 0ms
npm timing config:load:flatten Completed in 3ms
npm timing npm:load:display Completed in 5ms
npm verb logfile C:\tmp\nodejs\npm-cache\_logs\2022-11-10T18_04_58_302Z-debug-0.log
npm timing npm:load:logFile Completed in 8ms
npm timing npm:load:timers Completed in 0ms
npm timing npm:load:configScope Completed in 0ms
npm timing npm:load Completed in 29ms
npm timing arborist:ctor Completed in 1ms
npm timing idealTree:init Completed in 1244ms
npm timing idealTree:userRequests Completed in 2ms
npm timing arborist:ctor Completed in 0ms
npm http fetch GET 200 https://registry.npmjs.org/@chakra-ui/react 965ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/@emotion/react 9ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/@babel/core 5ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/react 8ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/@emotion/styled 5ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/framer-motion 9ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/react-dom 21ms (cache hit)
npm timing idealTree:#root Completed in 1165ms
npm timing idealTree:node_modules/chakra-ui-autocomplete Completed in 38ms
npm timing idealTree:buildDeps Completed in 1205ms
npm timing idealTree:fixDepFlags Completed in 23ms
npm timing idealTree Completed in 2502ms
npm timing reify:loadTrees Completed in 2503ms
npm timing reify:diffTrees Completed in 58ms
npm timing reify:retireShallow Completed in 0ms
npm timing reify:createSparse Completed in 2ms
npm timing reify:loadBundles Completed in 0ms
npm verb reify failed optional dependency D:\.........\node_modules\fsevents
npm timing reifyNode:node_modules/fsevents Completed in 19ms
npm timing reify:unpack Completed in 20ms
npm timing reify:unretire Completed in 1ms
npm timing build:queue Completed in 4ms
npm timing build:deps Completed in 5ms
npm timing build Completed in 5ms
npm timing reify:build Completed in 6ms
npm timing reify:trash Completed in 1ms
npm timing reify:save Completed in 584ms
npm http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/advisories/bulk 1031ms
npm timing auditReport:getReport Completed in 1047ms
npm timing metavuln:cache:get:security-advisory:nth-check:q9W4Mnp2CLaC09BzzYywfkVmzHJt3Pfi70IxO1TfKO7ZrbohQ6/nxWo3z5u4rueV2a6cv2KwRNGkr8INdCPsAA== Completed in 3ms
npm http fetch GET 200 https://registry.npmjs.org/nth-check 6ms (cache hit)
npm timing metavuln:packument:nth-check Completed in 7ms
npm timing metavuln:load:security-advisory:nth-check:1070415 Completed in 1ms
npm timing metavuln:calculate:security-advisory:nth-check:1070415 Completed in 9ms
npm timing metavuln:cache:get:security-advisory:css-select:Cxw9fRDewmSWmgz2FKrA6NxOmfFcZUbDmGpLvLcdHOYo/u/2s4slp6 dC0iXKYoI5W/3wY96QWqliI2xwnvevA== Completed in 2ms
npm http fetch GET 200 https://registry.npmjs.org/css-select 5ms (cache hit)
npm timing metavuln:packument:css-select Completed in 6ms
npm timing metavuln:load:security-advisory:css-select:q9W4Mnp2CLaC09BzzYywfkVmzHJt3Pfi70IxO1TfKO7ZrbohQ6/nxWo3z5u4rueV2a6cv2KwRNGkr8INdCPsAA== Completed in 0ms
npm timing metavuln:calculate:security-advisory:css-select:q9W4Mnp2CLaC09BzzYywfkVmzHJt3Pfi70IxO1TfKO7ZrbohQ6/nxWo3z5u4rueV2a6cv2KwRNGkr8INdCPsAA== Completed in 6ms
npm timing metavuln:cache:get:security-advisory:svgo:0505IGBCsLcG763PwR0Yit9arHQYlHm1It3auR OOjX5CKb88KrcjEUM7C7TuJTr7sIri9shjQYUDOTjtJ7VxQ== Completed in 1ms
npm http fetch GET 200 https://registry.npmjs.org/svgo 4ms (cache hit)
npm timing metavuln:packument:svgo Completed in 6ms
npm timing metavuln:load:security-advisory:svgo:Cxw9fRDewmSWmgz2FKrA6NxOmfFcZUbDmGpLvLcdHOYo/u/2s4slp6 dC0iXKYoI5W/3wY96QWqliI2xwnvevA== Completed in 0ms
npm timing metavuln:calculate:security-advisory:svgo:Cxw9fRDewmSWmgz2FKrA6NxOmfFcZUbDmGpLvLcdHOYo/u/2s4slp6 dC0iXKYoI5W/3wY96QWqliI2xwnvevA== Completed in 6ms
npm timing metavuln:cache:get:security-advisory:@svgr/plugin-svgo:CqjIE74LUybGuzhbOcPvgfmJJ4AN 3Cmq9FzZDiCt1ELxnaKCAoZjGUaNxVFfq HJFg9p5IcyhjSc8wXjotVFw== Completed in 2ms
npm http fetch GET 200 https://registry.npmjs.org/@svgr/plugin-svgo 5ms (cache hit)
npm timing metavuln:packument:@svgr/plugin-svgo Completed in 7ms
npm timing metavuln:load:security-advisory:@svgr/plugin-svgo:0505IGBCsLcG763PwR0Yit9arHQYlHm1It3auR OOjX5CKb88KrcjEUM7C7TuJTr7sIri9shjQYUDOTjtJ7VxQ== Completed in 0ms
npm timing metavuln:calculate:security-advisory:@svgr/plugin-svgo:0505IGBCsLcG763PwR0Yit9arHQYlHm1It3auR OOjX5CKb88KrcjEUM7C7TuJTr7sIri9shjQYUDOTjtJ7VxQ== Completed in 7ms
npm timing metavuln:cache:get:security-advisory:@svgr/webpack:6kGFeBaa c/FiSh7gkidT8uneFtpq6JLmia0 ROmr6BVMW4bnUZ9bZd/dO Squ13eCU8 LJ9HJjq2v7UKojEPA== Completed in 2ms
npm http fetch GET 200 https://registry.npmjs.org/@svgr/webpack 4ms (cache hit)
npm timing metavuln:packument:@svgr/webpack Completed in 5ms
npm timing metavuln:load:security-advisory:@svgr/webpack:CqjIE74LUybGuzhbOcPvgfmJJ4AN 3Cmq9FzZDiCt1ELxnaKCAoZjGUaNxVFfq HJFg9p5IcyhjSc8wXjotVFw== Completed in 1ms
npm timing metavuln:calculate:security-advisory:@svgr/webpack:CqjIE74LUybGuzhbOcPvgfmJJ4AN 3Cmq9FzZDiCt1ELxnaKCAoZjGUaNxVFfq HJFg9p5IcyhjSc8wXjotVFw== Completed in 6ms
npm timing metavuln:cache:get:security-advisory:react-scripts:jzAvVcibtp6793goF6bMS 3REmxevJ33fk CUpasW439H9DWo8HZryeL2vn3uGr5kT2MYZIC9lZQ2/rASfNe7w== Completed in 2ms
npm http fetch GET 200 https://registry.npmjs.org/react-scripts 6ms (cache hit)
npm timing metavuln:packument:react-scripts Completed in 10ms
npm timing metavuln:load:security-advisory:react-scripts:6kGFeBaa c/FiSh7gkidT8uneFtpq6JLmia0 ROmr6BVMW4bnUZ9bZd/dO Squ13eCU8 LJ9HJjq2v7UKojEPA== Completed in 1ms
npm timing metavuln:calculate:security-advisory:react-scripts:6kGFeBaa c/FiSh7gkidT8uneFtpq6JLmia0 ROmr6BVMW4bnUZ9bZd/dO Squ13eCU8 LJ9HJjq2v7UKojEPA== Completed in 11ms
npm timing auditReport:init Completed in 69ms
npm timing reify:audit Completed in 1117ms
npm timing reify Completed in 3688ms
npm timing command:update Completed in 3708ms
npm verb exit 0
npm timing npm Completed in 4195ms
npm info ok 

CodePudding user response:

It seems you have to do npm update --save if you actually want the changes to be reflected in package.json. Apparently the changes were always working behind the scenes, and package-lock.json was being updated, but not package.json.

  • Related