如何找到npm配置错误或从头开始重置npm?

时间:2015-12-22 17:55:05

标签: node.js npm package.json

我创建了一个测试项目文件夹,其中包含一个非常简单的package.json:

{
  "name": "my-project",
  "version": "1.0.0",
  "devDependencies": {
    "babel-cli": "^6.0.0"
  }
}

虽然在项目文件夹中运行npm install,但它会安装很多软件包。所有这些都来自哪里?在某处的npm配置中是否存在错误?

现在在我的node_modules文件夹中:

amdefine
ansi-green
ansi-regex
ansi-styles
ansi-wrap
anymatch
arr-diff
arr-flatten
array-uniq
array-unique
arrify
asn1
assert-plus
async
async-each
aws-sign2
babel-cli
babel-code-frame
babel-core
babel-generator
babel-helpers
babel-messages
babel-polyfill
babel-regenerator-runtime
babel-register
babel-runtime
babel-template
babel-traverse
babel-types
babylon
balanced-match
bin-version
bin-version-check
binary-extensions
bl
boom
brace-expansion
braces
builtin-modules
camelcase
camelcase-keys
caseless
chalk
chokidar
combined-stream
commander
concat-map
convert-source-map
core-js
core-util-is
cryptiles
dashdash
debug
delayed-stream
detect-indent
ecc-jsbn
error-ex
escape-string-regexp
esutils
expand-brackets
expand-range
extend
extglob
extsprintf
filename-regex
fill-range
find-up
find-versions
for-in
for-own
forever-agent
form-data
fs-readdir-recursive
fsevents
generate-function
generate-object-property
get-stdin
glob
glob-base
glob-parent
globals
graceful-fs
graceful-readlink
har-validator
has-ansi
hawk
hoek
home-or-tmp
hosted-git-info
http-signature
indent-string
inflight
inherits
invariant
is-arrayish
is-binary-path
is-buffer
is-builtin-module
is-dotfile
is-equal-shallow
is-extendable
is-extglob
is-finite
is-glob
is-integer
is-my-json-valid
is-number
is-primitive
is-property
is-typedarray
is-utf8
isarray
isobject
isstream
jodid25519
js-tokens
jsbn
json-schema
json-stringify-safe
json5
jsonpointer
jsprim
kind-of
left-pad
line-numbers
load-json-file
lodash
log-symbols
loose-envify
loud-rejection
map-obj
meow
micromatch
mime-db
mime-types
minimatch
minimist
mkdirp
ms
nan
node-uuid
normalize-package-data
normalize-path
number-is-nan
oauth-sign
object-assign
object.omit
once
os-tmpdir
output-file-sync
parse-glob
parse-json
path-exists
path-is-absolute
path-type
pify
pinkie
pinkie-promise
preserve
private
process-nextick-args
qs
randomatic
read-pkg
read-pkg-up
readable-stream
readdirp
redent
regex-cache
repeat-element
repeat-string
repeating
request
semver
semver-regex
semver-truncate
shebang-regex
signal-exit
slash
sntp
source-map
source-map-support
spdx-correct
spdx-exceptions
spdx-expression-parse
spdx-license-ids
sshpk
string_decoder
stringstream
strip-ansi
strip-bom
strip-indent
success-symbol
supports-color
to-fast-properties
tough-cookie
trim-newlines
trim-right
tunnel-agent
tweetnacl
user-home
util-deprecate
v8flags
validate-npm-package-license
verror
wrappy
xtend

如果我以某种方式破坏了我的npm配置,重置它的最佳方法是什么?我可以用它卸载node / npm及其所有内容吗?

1 个答案:

答案 0 :(得分:0)

你可能已经发了命令

  

npm install

在您创建其他文件时在同一文件夹中。

babel-cli单独有20个依赖项: v8flags,source-map,slash,request,path-is-absolute,path-exists,output-file-sync,log-symbols,lodash,glob,fs-readdir-recursive,convert-source-map,commander,chokidar,粉笔,bin-version-check,babel-runtime,babel-polyfill,babel-register,babel-core