先用-save-dev
方法添加express的框架依赖之后
(详情看菜鸟https://www.runoob.com/nodejs/nodejs-express-framework.html)
使用 npm list
查看项目包列表
类似出现这样的错误,但是很奇怪我刚才的express框架文件能够正常运行。(我全局方式安装过)
然后试了试用 npm install xxx
再安装本地就消除他的UNMET DEPENDENCY
警告
+-- body-parser@1.19.0 | +-- bytes@3.1.0 | +-- content-type@1.0.4 | +-- debug@2.6.9 | | `-- ms@2.0.0 | +-- depd@1.1.2 | +-- http-errors@1.7.2 | | +-- depd@1.1.2 deduped | | +-- inherits@2.0.3 | | +-- setprototypeof@1.1.1 | | +-- statuses@1.5.0 | | `-- toidentifier@1.0.0 | +-- iconv-lite@0.4.24 | | `-- safer-buffer@2.1.2 | +-- on-finished@2.3.0 | | `-- ee-first@1.1.1 | +-- qs@6.7.0 | +-- raw-body@2.4.0 | | +-- bytes@3.1.0 deduped | | +-- http-errors@1.7.2 deduped | | +-- iconv-lite@0.4.24 deduped | | `-- unpipe@1.0.0 | `-- type-is@1.6.18 | +-- media-typer@0.3.0 | `-- mime-types@2.1.26 | `-- mime-db@1.43.0
+-- UNMET DEPENDENCY cookie-parser@^1.4.5
+-- UNMET DEPENDENCY express@^4.17.1
+-- html-webpack-plugin@4.0.1 | +-- html-minifier-terser@5.0.5 | | +-- camel-case@4.1.1 | | | +-- pascal-case@3.1.1 | | | | +-- no-case@3.0.3 | | | | | +-- lower-case@2.0.1 | | | | | | `-- tslib@1.11.1 deduped | | | | | `-- tslib@1.11.1 deduped | | | | `-- tslib@1.11.1 deduped | | | `-- tslib@1.11.1 deduped | | +-- clean-css@4.2.3 | | | `-- source-map@0.6.1 | | +-- commander@4.1.1 | | +-- he@1.2.0 | | +-- param-case@3.0.3 | | | +-- dot-case@3.0.3 | | | | +-- no-case@3.0.3 deduped | | | | `-- tslib@1.11.1 deduped | | | `-- tslib@1.11.1 deduped | | +-- relateurl@0.2.7 | | `-- terser@4.6.7 | | +-- commander@2.20.3 | | +-- source-map@0.6.1 | | `-- source-map-support@0.5.16 | | +-- buffer-from@1.1.1 | | `-- source-map@0.6.1 | +-- loader-utils@1.4.0 | | +-- big.js@5.2.2 | | +-- emojis-list@3.0.0 | | `-- json5@1.0.1 | | `-- minimist@1.2.5 | +-- lodash@4.17.15 | +-- pretty-error@2.1.1 | | +-- renderkid@2.0.3 | | |
+-- css-select@1.2.0 | | | | +-- boolbase@1.0.0 | | | | +-- css-what@2.1.3 | | | | +-- domutils@1.5.1 | | | | | +-- dom-serializer@0.2.2 | | | | | | +-- domelementtype@2.0.1 | | | | | | `-- entities@2.0.0 | | | | | `-- domelementtype@1.3.1 deduped | | | | `-- nth-check@1.0.2 | | | | `-- boolbase@1.0.0 deduped | | | +-- dom-converter@0.2.0 | | | | `-- utila@0.4.0 deduped | | | +-- htmlparser2@3.10.1 | | | | +-- domelementtype@1.3.1 | | | | +-- domhandler@2.4.2 | | | | | `-- domelementtype@1.3.1 deduped | | | |
+-- domutils@1.5.1 deduped | | | | +-- entities@1.1.2 | | | | +-- inherits@2.0.4 deduped | | | | `-- readable-stream@3.6.0 | | | | +-- inherits@2.0.4 deduped | | | | +-- string_decoder@1.3.0 | | | | | `-- safe-buffer@5.2.0 | | | | `-- util-deprecate@1.0.2 deduped | | |
+-- strip-ansi@3.0.1 | | | | `-- ansi-regex@2.1.1 | | | `-- utila@0.4.0 deduped | | `-- utila@0.4.0 | +-- tapable@1.1.3 | `-- util.promisify@1.0.0 | +-- define-properties@1.1.3 | | `-- object-keys@1.1.1 | `-- object.getownpropertydescriptors@2.1.0 |
+-- define-properties@1.1.3 deduped | `-- es-abstract@1.17.5 | +-- es-to-primitive@1.2.1 | | +-- is-callable@1.1.5 deduped | | +-- is-date-object@1.0.2 | | `-- is-symbol@1.0.3 | | `-- has-symbols@1.0.1 deduped | +-- function-bind@1.1.1 |
+-- has@1.0.3 | | `-- function-bind@1.1.1 deduped | +-- has-symbols@1.0.1 | +-- is-callable@1.1.5 | +-- is-regex@1.0.5 | | `-- has@1.0.3 deduped | +-- object-inspect@1.7.0 | +-- object-keys@1.1.1 deduped | +-- object.assign@4.1.0 | | +-- define-properties@1.1.3 deduped | | +-- function-bind@1.1.1 deduped | | +-- has-symbols@1.0.1 deduped | | `-- object-keys@1.1.1 deduped | +-- string.prototype.trimleft@2.1.1 | | +-- define-properties@1.1.3 deduped | | `-- function-bind@1.1.1 deduped | `-- string.prototype.trimright@2.1.1 | +-- define-properties@1.1.3 deduped | `-- function-bind@1.1.1 deduped
+-- multer@1.4.2 | +-- append-field@1.0.0 | +-- busboy@0.2.14 | | +-- dicer@0.2.5 | | | +-- readable-stream@1.1.14 | | | | +-- core-util-is@1.0.2 deduped | | | | +-- inherits@2.0.4 deduped | | | |
+-- isarray@0.0.1 deduped | | | | `-- string_decoder@0.10.31 | | | `-- streamsearch@0.1.2 | | `-- readable-stream@1.1.14 | | +-- core-util-is@1.0.2 | | +-- inherits@2.0.4 deduped | | +-- isarray@0.0.1 | | `-- string_decoder@0.10.31 | +-- concat-stream@1.6.2 | | +-- buffer-from@1.1.1 | | +-- inherits@2.0.4 | | +-- readable-stream@2.3.7 | | | +-- core-util-is@1.0.2 deduped | | |
+-- inherits@2.0.4 deduped | | | +-- isarray@1.0.0 | | | +-- process-nextick-args@2.0.1 | | | +-- safe-buffer@5.1.2 | | | +-- string_decoder@1.1.1 | | | | `-- safe-buffer@5.1.2 deduped | | | `-- util-deprecate@1.0.2 | | `-- typedarray@0.0.6 | +-- mkdirp@0.5.4 | | `-- minimist@1.2.5 | +-- object-assign@4.1.1 | +-- on-finished@2.3.0 deduped | +-- type-is@1.6.18 deduped | `-- xtend@4.0.2 `-- webpack@4.42.1 +-- @webassemblyjs/ast@1.9.0 | +-- @webassemblyjs/helper-module-context@1.9.0 deduped | +-- @webassemblyjs/helper-wasm-bytecode@1.9.0 | `-- @webassemblyjs/wast-parser@1.9.0 | +-- @webassemblyjs/ast@1.9.0 deduped | +-- @webassemblyjs/floating-point-hex-parser@1.9.0 |
+-- @webassemblyjs/helper-api-error@1.9.0 deduped | +-- @webassemblyjs/helper-code-frame@1.9.0 | | `-- @webassemblyjs/wast-printer@1.9.0 deduped | +-- @webassemblyjs/helper-fsm@1.9.0 | `-- @xtuc/long@4.2.2 +-- @webassemblyjs/helper-module-context@1.9.0 | `-- @webassemblyjs/ast@1.9.0 deduped +-- @webassemblyjs/wasm-edit@1.9.0 | +-- @webassemblyjs/ast@1.9.0 deduped | +-- @webassemblyjs/helper-buffer@1.9.0 | +-- @webassemblyjs/helper-wasm-bytecode@1.9.0 deduped | +-- @webassemblyjs/helper-wasm-section@1.9.0 | | +-- @webassemblyjs/ast@1.9.0 deduped | | +-- @webassemblyjs/helper-buffer@1.9.0 deduped | | +-- @webassemblyjs/helper-wasm-bytecode@1.9.0 deduped | | `-- @webassemblyjs/wasm-gen@1.9.0 deduped | +-- @webassemblyjs/wasm-gen@1.9.0 | | +-- @webassemblyjs/ast@1.9.0 deduped | | +-- @webassemblyjs/helper-wasm-bytecode@1.9.0 deduped | | +-- @webassemblyjs/ieee754@1.9.0 deduped | | +-- @webassemblyjs/leb128@1.9.0 deduped | | `-- @webassemblyjs/utf8@1.9.0 deduped | +-- @webassemblyjs/wasm-op