npm过期-g不起作用,发生错误

时间:2019-05-16 10:56:27

标签: npm

如果我检查最新的全局npm软件包,则面临问题:

C:\Users\Xin>npm outdated -g
npm ERR! Cannot read property 'length' of undefined

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Xin\AppData\Roaming\npm-cache\_logs\2019-05-16T09_34_44_582Z-debug.log

错误日志如下:

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Users\\Xin\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'outdated',
1 verbose cli   '--global' ]
2 info using npm@6.9.0
3 info using node@v10.15.3
4 verbose npm-session 2407c2fb873b413f
5 http fetch GET 304 https://registry.npmjs.org/audit-ci 721ms (from cache)
6 silly pacote registry packument for audit-ci@1.4.1 fetched in 740ms
7 http fetch GET 304 https://registry.npmjs.org/depcheck 720ms (from cache)
8 silly pacote registry packument for depcheck@0.7.2 fetched in 741ms
9 http fetch GET 304 https://registry.npmjs.org/gulp 723ms (from cache)
10 silly pacote registry packument for gulp@4.0.0 fetched in 744ms
11 http fetch GET 304 https://registry.npmjs.org/npm-check 722ms (from cache)
12 silly pacote registry packument for npm-check@5.9.0 fetched in 746ms
13 http fetch GET 304 https://registry.npmjs.org/node-gyp 734ms (from cache)
14 silly pacote registry packument for node-gyp@4.0.0 fetched in 756ms
15 http fetch GET 304 https://registry.npmjs.org/prettier 733ms (from cache)
16 silly pacote registry packument for prettier@1.16.4 fetched in 759ms
17 http fetch GET 304 https://registry.npmjs.org/yarn 737ms (from cache)
18 silly pacote registry packument for yarn@1.13.0 fetched in 766ms
19 http fetch GET 304 https://registry.npmjs.org/pm2 748ms (from cache)
20 silly pacote registry packument for pm2@3.4.0 fetched in 776ms
21 http fetch GET 304 https://registry.npmjs.org/npm 767ms (from cache)
22 silly pacote registry packument for npm@6.9.0 fetched in 805ms
23 verbose stack TypeError: Cannot read property 'length' of undefined
23 verbose stack     at dotindex (C:\Users\Xin\AppData\Roaming\npm\node_modules\npm\node_modules\text-table\index.js:59:32)
23 verbose stack     at C:\Users\Xin\AppData\Roaming\npm\node_modules\npm\node_modules\text-table\index.js:11:21
23 verbose stack     at Array.forEach (<anonymous>)
23 verbose stack     at forEach (C:\Users\Xin\AppData\Roaming\npm\node_modules\npm\node_modules\text-table\index.js:73:31)
23 verbose stack     at C:\Users\Xin\AppData\Roaming\npm\node_modules\npm\node_modules\text-table\index.js:10:9
23 verbose stack     at Array.reduce (<anonymous>)
23 verbose stack     at reduce (C:\Users\Xin\AppData\Roaming\npm\node_modules\npm\node_modules\text-table\index.js:63:30)
23 verbose stack     at module.exports (C:\Users\Xin\AppData\Roaming\npm\node_modules\npm\node_modules\text-table\index.js:9:20)
23 verbose stack     at C:\Users\Xin\AppData\Roaming\npm\node_modules\npm\lib\outdated.js:130:16
23 verbose stack     at cb (C:\Users\Xin\AppData\Roaming\npm\node_modules\npm\node_modules\slide\lib\async-map.js:47:24)
23 verbose stack     at outdated_ (C:\Users\Xin\AppData\Roaming\npm\node_modules\npm\lib\outdated.js:221:12)
23 verbose stack     at skip (C:\Users\Xin\AppData\Roaming\npm\node_modules\npm\lib\outdated.js:343:5)
23 verbose stack     at updateDeps (C:\Users\Xin\AppData\Roaming\npm\node_modules\npm\lib\outdated.js:446:7)
23 verbose stack     at tryCatcher (C:\Users\Xin\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\util.js:16:23)
23 verbose stack     at Promise.successAdapter [as _fulfillmentHandler0] (C:\Users\Xin\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\nodeify.js:23:30)
23 verbose stack     at Promise._settlePromise (C:\Users\Xin\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:566:21)
24 verbose cwd C:\Users\Xin
25 verbose Windows_NT 10.0.17763
26 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Xin\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "outdated" "--global"
27 verbose node v10.15.3
28 verbose npm  v6.9.0
29 error Cannot read property 'length' of undefined
30 verbose exit [ 1, true ]

0 个答案:

没有答案