本文介绍了npm install安装在package.json中未指定的额外软件包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我在AWS ec2实例上有一个非常典型的 package.json 。我正在运行 npm install ,而不是安装I have a fairly typical package.json on an AWS ec2 instance. I'm running npm install and instead of installing{ "name": "angular-app-server", "description": "Back end server to support our angular app", "version": "0.0.1", "private": true, "dependencies": { "assert": "^1.3.0", "async": "^0.9.0", "bcrypt-nodejs": "0.0.3", "body-parser": "^1.13.1", "connect-multiparty": "^1.2.5", "express": "~3.0", "express-namespace": "~0.1.1", "express-session": "^1.11.1", "forever": "^0.14.2", "mongodb": "^2.0.36", "multiparty": "^4.1.2", "nodemailer": "^1.3.4", "open": "0.0.3", "passport": "~0.1.12", "passport-local": "~0.1.6", "request": "~2.16.6", "svgo": "^0.5.3" }, "devDependencies": { "grunt": "~0.4", "grunt-contrib-jshint": "~0.2.0", "grunt-contrib-nodeunit": "~0.1.2", "rewire": "^2.0.1", "supervisor": "~0.4.1" }}它正在安装数十个软件包,(通过 cd node_modules & ls ):It's installing dozens and dozens of packages, (via cd node_modules & ls): abbrev findup-sync on-finishedaddressparser first-chunk-stream on-headersalign-text flatiron openamdefine foreground-child openeransi-regex forever optimistansi-styles forever-agent optionatorargparse forever-monitor parseurlasn1 form-data passportassert formidable passport-localassert-plus fresh path-is-absoluteasync getobject pauseaws-sign glob peakleaws-sign2 graceful-fs pendbalanced-match grunt pkginfobase64-url grunt-contrib-jshint prelude-lsbcrypt-nodejs grunt-contrib-nodeunit promptbody-parser grunt-legacy-log ps-treeboom grunt-legacy-log-utils punycodebrace-expansion grunt-legacy-util qbroadway handlebars qsbson has-ansi range-parserbuffer-crc32 hawk raw-bodybuffer-equal hoek readbuildmail hooker readable-streambytes http-errors repeat-stringcamelcase http-signature requestcenter-align hyperquest resolvechalk i revalidatorcli iconv-lite rewirecliff inflight right-aligncliui inherits rimrafclone ini saxcoa isarray sendcoffee-script isstream shelljscolors istanbul sigmundcombined-stream is-utf8 signal-exitcommander jshint smtp-connectionconcat-map json-stringify-safe sntpconnect js-yaml source-mapconnect-multiparty kerberos spawn-wrapcontent-type kind-of sprintf-jscookie lazy stack-tracecookie-jar lcov-parse statusescookie-signature levn stream-countercore-util-is libbase64 string_decodercoveralls libmime stringstreamcrc libqp strip-ansicryptiles lodash strip-bomctype log-driver supervisorcycle longest supports-colordateformat lru-cache svgodebug media-typer tapdecamelize methods tap-mocha-reporterdeep-equal mime tap-parserdeep-is mime-db through2delayed-stream mime-types timespandepd minimatch tough-cookiediff minimist tunnel-agentdirector mkdirp type-checkduplexer2 mongodb type-isee-first mongodb-core uglify-jses6-promise ms uid-safeescape-string-regexp multiparty underscoreescodegen mute-stream underscore.stringesprima nan unicode-lengthestraverse nconf unpipeesutils ncp utileventemitter2 nodemailer utileevents-to-array nodemailer-direct-transport utils-mergeevent-stream nodemailer-smtp-transport watchexit nodemailer-wellknown whet.extendexpress nodeunit whichexpress-namespace node-uuid window-sizeexpress-session nopt winstoneyes nssocket wordwrapfast-levenshtein nyc wrappyfd-slicer oauth-sign xtendfileset once yargs什么可能是这个原因? What could be the cause of this? 感谢您的任何建议或帮助。 Thanks for any advice or help. 推荐答案这是NPM 2和NPM 3之间的区别。 NPM 3将放置依赖项的第一个版本This is a difference between NPM 2 and NPM 3.NPM 3 will put the first version of a dependency as a peer and other versions of a dependency nested. https://docs.npmjs.com/how-npm-works/npm3 https://github.com/npm/npm/issues/11586 我想它看起来较难看,但占用的空间较小。I guess it looks uglier, but takes less space. 这篇关于npm install安装在package.json中未指定的额外软件包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-19 00:40