输入webpack -v 提示:bash: webpack: command not found
来源:3-4 npm和webpack的初始化
闫小样丶
2020-09-05
Administrator@PC201711131015 MINGW64 /f/workSpace/mmall-fe (mmall_v1.0)
$ npm install webpack -g
npm WARN engine webpack@4.44.1: wanted: {"node":">=6.11.5"} (current: {"node":"4.4.7","npm":"2.15.8" })
npm WARN engine tapable@1.1.3: wanted: {"node":">=6"} (current: {"node":"4.4.7","npm":"2.15.8"})
npm WARN engine terser-webpack-plugin@1.4.5: wanted: {"node":">= 6.9.0"} (current: {"node":"4.4.7"," npm":"2.15.8"})
npm WARN engine chrome-trace-event@1.0.2: wanted: {"node":">=6.0"} (current: {"node":"4.4.7","npm":" 2.15.8"})
npm WARN engine enhanced-resolve@4.3.0: wanted: {"node":">=6.9.0"} (current: {"node":"4.4.7","npm":" 2.15.8"})
npm WARN engine chokidar@3.4.2: wanted: {"node":">= 8.10.0"} (current: {"node":"4.4.7","npm":"2.15.8 "})
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 1 5x less dependencies.
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN engine fsevents@2.1.3: wanted: {"node":"^8.16.0 || ^10.6.0 || >=11.0.0"} (current: {"node": "4.4.7","npm":"2.15.8"})
npm WARN engine anymatch@3.1.1: wanted: {"node":">= 8"} (current: {"node":"4.4.7","npm":"2.15.8"})
npm WARN engine glob-parent@5.1.1: wanted: {"node":">= 6"} (current: {"node":"4.4.7","npm":"2.15.8"} )
npm WARN engine braces@3.0.2: wanted: {"node":">=8"} (current: {"node":"4.4.7","npm":"2.15.8"})
npm WARN engine readdirp@3.4.0: wanted: {"node":">=8.10.0"} (current: {"node":"4.4.7","npm":"2.15.8" })
npm WARN engine is-binary-path@2.1.0: wanted: {"node":">=8"} (current: {"node":"4.4.7","npm":"2.15.8 "})
npm WARN optional dep failed, continuing fsevents@1.2.13
npm WARN optional dep failed, continuing fsevents@2.1.3
npm WARN engine find-cache-dir@2.1.0: wanted: {"node":">=6"} (current: {"node":"4.4.7","npm":"2.15.8 "})
npm WARN engine terser@4.8.0: wanted: {"node":">=6.0.0"} (current: {"node":"4.4.7","npm":"2.15.8"})
npm WARN engine binary-extensions@2.1.0: wanted: {"node":">=8"} (current: {"node":"4.4.7","npm":"2.1 5.8"})
npm WARN engine picomatch@2.2.2: wanted: {"node":">=8.6"} (current: {"node":"4.4.7","npm":"2.15.8"})
npm WARN engine picomatch@2.2.2: wanted: {"node":">=8.6"} (current: {"node":"4.4.7","npm":"2.15.8"})
npm WARN engine fill-range@7.0.1: wanted: {"node":">=8"} (current: {"node":"4.4.7","npm":"2.15.8"})
npm WARN engine pkg-dir@3.0.0: wanted: {"node":">=6"} (current: {"node":"4.4.7","npm":"2.15.8"})
npm WARN engine make-dir@2.1.0: wanted: {"node":">=6"} (current: {"node":"4.4.7","npm":"2.15.8"})
npm WARN engine to-regex-range@5.0.1: wanted: {"node":">=8.0"} (current: {"node":"4.4.7","npm":"2.15 .8"})
npm WARN engine pify@4.0.1: wanted: {"node":">=6"} (current: {"node":"4.4.7","npm":"2.15.8"})
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN engine atob@2.1.2: wanted: {"node":">= 4.5.0"} (current: {"node":"4.4.7","npm":"2.15.8"})
npm WARN engine find-up@3.0.0: wanted: {"node":">=6"} (current: {"node":"4.4.7","npm":"2.15.8"})
npm WARN engine punycode@2.1.1: wanted: {"node":">=6"} (current: {"node":"4.4.7","npm":"2.15.8"})
npm WARN engine readable-stream@3.6.0: wanted: {"node":">= 6"} (current: {"node":"4.4.7","npm":"2.15 .8"})
npm WARN engine locate-path@3.0.0: wanted: {"node":">=6"} (current: {"node":"4.4.7","npm":"2.15.8"})
npm WARN engine readable-stream@3.6.0: wanted: {"node":">= 6"} (current: {"node":"4.4.7","npm":"2.15 .8"})
npm WARN engine readable-stream@3.6.0: wanted: {"node":">= 6"} (current: {"node":"4.4.7","npm":"2.15 .8"})
npm WARN engine readable-stream@3.6.0: wanted: {"node":">= 6"} (current: {"node":"4.4.7","npm":"2.15 .8"})
npm WARN engine readable-stream@3.6.0: wanted: {"node":">= 6"} (current: {"node":"4.4.7","npm":"2.15 .8"})
npm WARN engine p-locate@3.0.0: wanted: {"node":">=6"} (current: {"node":"4.4.7","npm":"2.15.8"})
npm WARN engine readable-stream@3.6.0: wanted: {"node":">= 6"} (current: {"node":"4.4.7","npm":"2.15 .8"})
npm WARN engine p-limit@2.3.0: wanted: {"node":">=6"} (current: {"node":"4.4.7","npm":"2.15.8"})
npm WARN engine p-try@2.2.0: wanted: {"node":">=6"} (current: {"node":"4.4.7","npm":"2.15.8"})
npm WARN engine readable-stream@3.6.0: wanted: {"node":">= 6"} (current: {"node":"4.4.7","npm":"2.15 .8"})
npm WARN engine atob@2.1.2: wanted: {"node":">= 4.5.0"} (current: {"node":"4.4.7","npm":"2.15.8"})
C:\Program Files\nodejs\node_global\webpack -> C:\Program Files\nodejs\node_global\node_modules\webp ack\bin\webpack.js
webpack@4.44.1 C:\Program Files\nodejs\node_global\node_modules\webpack
├── json-parse-better-errors@1.0.2
├── loader-runner@2.4.0
├── @webassemblyjs/helper-module-context@1.9.0
├── tapable@1.1.3
├── acorn@6.4.1
├── ajv-keywords@3.5.2
├── schema-utils@1.0.0 (ajv-errors@1.0.1)
├── chrome-trace-event@1.0.2 (tslib@1.13.0)
├── mkdirp@0.5.5 (minimist@1.2.5)
├── eslint-scope@4.0.3 (estraverse@4.3.0, esrecurse@4.3.0)
├── webpack-sources@1.4.3 (source-list-map@2.0.1, source-map@0.6.1)
├── loader-utils@1.4.0 (emojis-list@3.0.0, big.js@5.2.2, json5@1.0.1)
├── neo-async@2.6.2
├── @webassemblyjs/wasm-parser@1.9.0 (@webassemblyjs/helper-api-error@1.9.0, @webassemblyjs/helper-w asm-bytecode@1.9.0, @webassemblyjs/utf8@1.9.0, @webassemblyjs/leb128@1.9.0, @webassemblyjs/ieee754@1 .9.0)
├── memory-fs@0.4.1 (errno@0.1.7, readable-stream@2.3.7)
├── @webassemblyjs/wasm-edit@1.9.0 (@webassemblyjs/wasm-opt@1.9.0, @webassemblyjs/helper-buffer@1.9. 0, @webassemblyjs/helper-wasm-bytecode@1.9.0, @webassemblyjs/helper-wasm-section@1.9.0, @webassembly js/wast-printer@1.9.0, @webassemblyjs/wasm-gen@1.9.0)
├── enhanced-resolve@4.3.0 (graceful-fs@4.2.4, memory-fs@0.5.0)
├── @webassemblyjs/ast@1.9.0 (@webassemblyjs/helper-wasm-bytecode@1.9.0, @webassemblyjs/wast-parser@ 1.9.0)
├── ajv@6.12.4 (json-schema-traverse@0.4.1, fast-deep-equal@3.1.3, fast-json-stable-stringify@2.1.0, uri-js@4.4.0)
├── terser-webpack-plugin@1.4.5 (is-wsl@1.1.0, source-map@0.6.1, serialize-javascript@4.0.0, worker- farm@1.7.0, terser@4.8.0, cacache@12.0.4, find-cache-dir@2.1.0)
├── node-libs-browser@2.2.1 (https-browserify@1.0.0, punycode@1.4.1, tty-browserify@0.0.0, path-brow serify@0.0.1, domain-browser@1.2.0, constants-browserify@1.0.0, os-browserify@0.3.0, process@0.11.10 , querystring-es3@0.2.1, console-browserify@1.2.0, vm-browserify@1.1.2, string_decoder@1.3.0, stream -browserify@2.0.2, util@0.11.1, timers-browserify@2.0.11, events@3.2.0, url@0.11.0, readable-stream@ 2.3.7, assert@1.5.0, stream-http@2.8.3, browserify-zlib@0.2.0, buffer@4.9.2, crypto-browserify@3.12. 0)
├── micromatch@3.1.10 (arr-diff@4.0.0, array-unique@0.3.2, kind-of@6.0.3, fragment-cache@0.2.1, nano match@1.2.13, object.pick@1.3.0, regex-not@1.0.2, to-regex@3.0.2, define-property@2.0.2, extend-shal low@3.0.2, extglob@2.0.4, snapdragon@0.8.2, braces@2.3.2)
└── watchpack@1.7.4 (graceful-fs@4.2.4, chokidar@3.4.2, watchpack-chokidar2@2.0.0)
Administrator@PC201711131015 MINGW64 /f/workSpace/mmall-fe (mmall_v1.0)
$ npm install webpack@1.15.0 --save-dev
npm WARN deprecated chokidar@1.7.0: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 1 5x less dependencies.
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN optional dep failed, continuing fsevents@1.2.13
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN engine atob@2.1.2: wanted: {"node":">= 4.5.0"} (current: {"node":"4.4.7","npm":"2.15.8"})
webpack@1.15.0 node_modules\webpack
├── interpret@0.6.6
├── clone@1.0.4
├── tapable@0.1.10
├── async@1.5.2
├── supports-color@3.2.3 (has-flag@1.0.0)
├── loader-utils@0.2.17 (object-assign@4.1.1, big.js@3.2.0, emojis-list@2.1.0, json5@0.5.1)
├── enhanced-resolve@0.9.1 (graceful-fs@4.2.4, memory-fs@0.2.0)
├── mkdirp@0.5.5 (minimist@1.2.5)
├── optimist@0.6.1 (wordwrap@0.0.3, minimist@0.0.10)
├── acorn@3.3.0
├── memory-fs@0.3.0 (errno@0.1.7, readable-stream@2.3.7)
├── webpack-core@0.6.9 (source-list-map@0.1.8, source-map@0.4.4)
├── uglify-js@2.7.5 (async@0.2.10, uglify-to-browserify@1.0.2, source-map@0.5.7, yargs@3.10.0)
├── node-libs-browser@0.7.0 (https-browserify@0.0.1, tty-browserify@0.0.0, path-browserify@0.0.0, pu nycode@1.4.1, string_decoder@0.10.31, constants-browserify@1.0.0, domain-browser@1.2.0, os-browserif y@0.2.1, process@0.11.10, console-browserify@1.2.0, querystring-es3@0.2.1, util@0.10.4, stream-brows erify@2.0.2, events@1.1.1, timers-browserify@2.0.11, vm-browserify@0.0.4, readable-stream@2.3.7, ass ert@1.5.0, url@0.11.0, buffer@4.9.2, stream-http@2.8.3, browserify-zlib@0.1.4, crypto-browserify@3.3 .0)
└── watchpack@0.2.9 (graceful-fs@4.2.4, async@0.9.2, chokidar@1.7.0)
写回答
1回答
-
闫小样丶
提问者
2020-09-05
老师给我报的 这个错误
Administrator@PC201711131015 MINGW64 /f/workSpace/mmall-fe (mmall_v1.0) $ webpack -v C:\Program Files\nodejs\node_global\node_modules\webpack\bin\webpack.js:90 let notify = ^^^ SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode at exports.runInThisContext (vm.js:53:16) at Module._compile (module.js:373:25) at Object.Module._extensions..js (module.js:416:10) at Module.load (module.js:343:32) at Function.Module._load (module.js:300:12) at Function.Module.runMain (module.js:441:10) at startup (node.js:139:18) at node.js:968:3
022020-09-08
相似问题