我正在尝试使用webpack-stats-graph直观地显示我的代码。 我通过运行“ npx webpack app / app.js app / dist / app.bundle.js --json> stats.json”创建了一个stats.json 当我运行webpack-stats-graph时出现错误
webpack-stats-graph
Reading stats from stats.json
Writing files to statsgraph
Error: dot: option - unrecognized
Usage: dot [-Vv?] [-(GNE)name=val] [-(KTlso)<val>] <dot files>
(additional options for neato) [-x] [-n<v>]
(additional options for fdp) [-L(gO)] [-L(nUCT)<val>]
(additional options for memtest) [-m<v>]
(additional options for config) [-cv]
-V - Print version and exit
-v - Enable verbose mode
-Gname=val - Set graph attribute 'name' to 'val'
-Nname=val - Set node attribute 'name' to 'val'
-Ename=val - Set edge attribute 'name' to 'val'
-Tv - Set output format to 'v'
-Kv - Set layout engine to 'v' (overrides default based on command name)
-lv - Use external library 'v'
-ofile - Write output to 'file'
-O - Automatically generate an output filename based on the input filename with a .'format' appended. (Causes all -ofile options to be ignored.)
-P - Internally generate a graph of the current plugins.
-q[l] - Set level of message suppression (=1)
-s[v] - Scale input by 'v' (=72)
-y - Invert y coordinate in output
-n[v] - No layout mode 'v' (=1)
-x - Reduce graph
-Lg - Don't use grid
-LO - Use old attractive force
-Ln<i> - Set number of iterations to i
-LU<i> - Set unscaled factor to i
-LC<v> - Set overlap expansion factor to v
-LT[*]<v> - Set temperature (temperature factor) to v
-m - Memory test (Observe no growth with top. Kill when done.)
-m[v] - Memory test - v iterations.
-c - Configure plugins (Writes $prefix/lib/graphviz/config
with available plugin information. Needs write privilege.)
-? - Print usage and exit
ERROR: Render failed
我的stats.json是
{
"errors": [],
"warnings": [],
"version": "3.7.1",
"hash": "3643d45e41ab664514f5",
"time": 60,
"publicPath": "",
"assetsByChunkName": {
"main": "app.bundle.js"
},
"assets": [
{
"name": "app.bundle.js",
"size": 3877,
"chunks": [
0
],
"chunkNames": [
"main"
],
"emitted": true
}
],
"filteredAssets": 0,
"entrypoints": {
"main": {
"chunks": [
0
],
"assets": [
"app.bundle.js"
]
}
},
"chunks": [
{
"id": 0,
"rendered": true,
"initial": true,
"entry": true,
"extraAsync": false,
"size": 994,
"names": [
"main"
],
"files": [
"app.bundle.js"
],
"hash": "73c00408edc65bd2d992",
"parents": [],
"modules": [
{
"id": 0,
"identifier": "C:\\Users\\...",
"name": "./app/app.js",
"index": 0,
"index2": 1,
"size": 94,
"cacheable": true,
"built": true,
"optional": false,
"prefetched": false,
"chunks": [
0
],
"assets": [],
"issuer": null,
"issuerId": null,
"issuerName": null,
"failed": false,
"errors": 0,
"warnings": 0,
"reasons": [],
"usedExports": true,
"providedExports": [],
"optimizationBailout": [],
"depth": 0,
"source": "import \"./klondike/scoring.js\";\r\nangular.module(\"solitaire\", [\"klondike\", \"ngDraggable\"]);\r\n\r\n"
},
{
"id": 1,
"identifier": "C:\\Users\\...",
"name": "./app/klondike/scoring.js",
"index": 1,
"index2": 0,
"size": 900,
"cacheable": true,
"built": true,
"optional": false,
"prefetched": false,
"chunks": [
0
],
"assets": [],
"issuer": "C:\\Users...",
"issuerId": 0,
"issuerName": "./app/app.js",
"failed": false,
"errors": 0,
"warnings": 0,
"reasons": [
{
"moduleId": 0,
"moduleIdentifier": "C:\\Users...",
"module": "./app/app.js",
"moduleName": "./app/app.js",
"type": "harmony import",
"userRequest": "./klondike/scoring.js",
"loc": "1:0-31"
}
],
"usedExports": false,
"providedExports": null,
"optimizationBailout": [],
"depth": 1,
"source": "angular.module(\"klondike.scoring\", [])\r\n .service(\"scoring\", [function Scoring() {\r\n \"use strict\";\r\n\r\n this.score = 0;\r\n\r\n this.newGame = function () {\r\n this.score = 0;\r\n };\r\n this.tableauCardTurnedUp = function () {\r\n this.score += 5;\r\n };\r\n this.dropped = function (source, destionation) {\r\n this.score += scoreForMoving(source, destionation) || 0;\r\n };\r\n this.wasteRecycled = function () {\r\n this.score = Math.max(this.score - 100, 0);\r\n };\r\n\r\n function scoreForMoving(source, destionation) {\r\n if (destionation.name === \"TableauPile\") {\r\n if (source.name === \"FoundationPile\") {\r\n return -15;\r\n }\r\n return 5;\r\n }\r\n if (destionation.name === \"FoundationPile\") {\r\n if (source.name === \"TableauPile\" || source.name === \"WastePile\") {\r\n return 10;\r\n }\r\n }\r\n }\r\n }]);\r\n"
}
],
"filteredModules": 0,
"origins": [
{
"moduleId": 0,
"module": "C:\\Users\\...",
"moduleIdentifier": "C:\\Users\\...",
"moduleName": "./app/app.js",
"loc": "",
"name": "main",
"reasons": []
}
]
}
],
"modules": [
{
"id": 0,
"identifier": "C:\\Users\\...",
"name": "./app/app.js",
"index": 0,
"index2": 1,
"size": 94,
"cacheable": true,
"built": true,
"optional": false,
"prefetched": false,
"chunks": [
0
],
"assets": [],
"issuer": null,
"issuerId": null,
"issuerName": null,
"failed": false,
"errors": 0,
"warnings": 0,
"reasons": [],
"usedExports": true,
"providedExports": [],
"optimizationBailout": [],
"depth": 0,
"source": "import \"./klondike/scoring.js\";\r\nangular.module(\"solitaire\", [\"klondike\", \"ngDraggable\"]);\r\n\r\n"
},
{
"id": 1,
"identifier": "C:\\Users\\...",
"name": "./app/klondike/scoring.js",
"index": 1,
"index2": 0,
"size": 900,
"cacheable": true,
"built": true,
"optional": false,
"prefetched": false,
"chunks": [
0
],
"assets": [],
"issuer": "C:\\Users\\...",
"issuerId": 0,
"issuerName": "./app/app.js",
"failed": false,
"errors": 0,
"warnings": 0,
"reasons": [
{
"moduleId": 0,
"moduleIdentifier": "C:\\Users\\...",
"module": "./app/app.js",
"moduleName": "./app/app.js",
"type": "harmony import",
"userRequest": "./klondike/scoring.js",
"loc": "1:0-31"
}
],
"usedExports": false,
"providedExports": null,
"optimizationBailout": [],
"depth": 1,
"source": "angular.module(\"klondike.scoring\", [])\r\n .service(\"scoring\", [function Scoring() {\r\n \"use strict\";\r\n\r\n this.score = 0;\r\n\r\n this.newGame = function () {\r\n this.score = 0;\r\n };\r\n this.tableauCardTurnedUp = function () {\r\n this.score += 5;\r\n };\r\n this.dropped = function (source, destionation) {\r\n this.score += scoreForMoving(source, destionation) || 0;\r\n };\r\n this.wasteRecycled = function () {\r\n this.score = Math.max(this.score - 100, 0);\r\n };\r\n\r\n function scoreForMoving(source, destionation) {\r\n if (destionation.name === \"TableauPile\") {\r\n if (source.name === \"FoundationPile\") {\r\n return -15;\r\n }\r\n return 5;\r\n }\r\n if (destionation.name === \"FoundationPile\") {\r\n if (source.name === \"TableauPile\" || source.name === \"WastePile\") {\r\n return 10;\r\n }\r\n }\r\n }\r\n }]);\r\n"
}
],
"filteredModules": 0,
"children": []
}
非常感谢您的帮助。是否缺少任何环境变量?或其他需要的初始化