我读过很多人提出的类似这样的问题,他们说npm update
对他们没有任何帮助。我也是这样,但没有一个解决方案对我有效,而且这种情况经常发生在我身上。它根本没有任何帮助。
现在我正在尝试将@chakra-ui/react
从我当前安装的版本更新到最新版本。我尝试了npm update
(希望能更新所有的东西,包括这个包),但是没有任何效果。所以我尝试了npm update @chakra-ui/react
,同样没有任何效果。在任何一个命令中添加-dd
都只会打印出一堆“计时”消息,也没有什么特别有用的东西。
以下是一些详细信息等:
- 据我所知,在
package.json
中,版本号前面有^
意味着它将从2.0.0更新到2.9999999.999999,但它永远不会更新到3.0.0。 - 我的
@chakra-ui/react
的package.json
是“^2.2.1”,NPM上的最新版本是2.3.7,所以这个 * 应该 * 得到更新,对吗?
这是package.json
和npm update -dd
的输出。
有人能看到我错过了什么吗?[rant]这太令人沮丧了,它总是发生在我身上,我总是要卸载/重新安装我试图更新的任何软件包。[/rant]
- 软件包.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"
]
}
}
- 输出:*
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 npm@8.5.5
npm info using node@v16.15.0
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%2freact 965ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/@emotion%2freact 9ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/@babel%2fcore 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%2fstyled 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%2fplugin-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%2fwebpack 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
1条答案
按热度按时间y3bcpkx11#
如果你真的想在
package.json
中反映出这些变化,你似乎必须做npm update --save
。显然,这些变化总是在幕后工作,package-lock.json
正在更新,而package.json
没有。