自己写的npm包在别人机器上安装后报错?

这是我写的一个练手的node小工具,我在本地开发的时候用了npm link,使用正常。然后在其他机器上npm install之后,运行就报错:

clipboard.png

但是yargs已经安装了:

C:\Users\v_syuanyang\AppData\Roaming\npm
`-- auto-annotation@0.0.3
  +-- ora@1.3.0
  | +-- chalk@1.1.3
  | | +-- ansi-styles@2.2.1
  | | +-- escape-string-regexp@1.0.5
  | | +-- has-ansi@2.0.0
  | | | `-- ansi-regex@2.1.1
  | | +-- strip-ansi@3.0.1
  | | `-- supports-color@2.0.0
  | +-- cli-cursor@2.1.0
  | | `-- restore-cursor@2.0.0
  | |   +-- onetime@2.0.1
  | |   `-- signal-exit@3.0.2
  | +-- cli-spinners@1.1.0
  | `-- log-symbols@1.0.2
  `-- yargs@9.0.1
    +-- camelcase@4.1.0
    +-- cliui@3.2.0
    | +-- string-width@1.0.2
    | | +-- code-point-at@1.1.0
    | | `-- is-fullwidth-code-point@1.0.0
    | |   `-- number-is-nan@1.0.1
    | `-- wrap-ansi@2.1.0
    |   `-- string-width@1.0.2
    +-- decamelize@1.2.0
    +-- get-caller-file@1.0.2
    +-- os-locale@2.1.0
    | +-- execa@0.7.0
    | | +-- cross-spawn@5.1.0
    | | | +-- lru-cache@4.1.1
    | | | | +-- pseudomap@1.0.2
    | | | | `-- yallist@2.1.2
    | | | +-- shebang-command@1.2.0
    | | | | `-- shebang-regex@1.0.0
    | | | `-- which@1.3.0
    | | |   `-- isexe@2.0.0
    | | +-- get-stream@3.0.0
    | | +-- is-stream@1.1.0
    | | +-- npm-run-path@2.0.2
    | | | `-- path-key@2.0.1
    | | +-- p-finally@1.0.0
    | | `-- strip-eof@1.0.0
    | +-- lcid@1.0.0
    | | `-- invert-kv@1.0.0
    | `-- mem@1.1.0
    |   `-- mimic-fn@1.1.0
    +-- read-pkg-up@2.0.0
    | +-- find-up@2.1.0
    | | `-- locate-path@2.0.0
    | |   +-- p-locate@2.0.0
    | |   | `-- p-limit@1.1.0
    | |   `-- path-exists@3.0.0
    | `-- read-pkg@2.0.0
    |   +-- load-json-file@2.0.0
    |   | +-- graceful-fs@4.1.11
    |   | +-- parse-json@2.2.0
    |   | | `-- error-ex@1.3.1
    |   | |   `-- is-arrayish@0.2.1
    |   | +-- pify@2.3.0
    |   | `-- strip-bom@3.0.0
    |   +-- normalize-package-data@2.4.0
    |   | +-- hosted-git-info@2.5.0
    |   | +-- is-builtin-module@1.0.0
    |   | | `-- builtin-modules@1.1.1
    |   | +-- semver@5.4.1
    |   | `-- validate-npm-package-license@3.0.1
    |   |   +-- spdx-correct@1.0.2
    |   |   | `-- spdx-license-ids@1.2.2
    |   |   `-- spdx-expression-parse@1.0.4
    |   `-- path-type@2.0.0
    +-- require-directory@2.1.1
    +-- require-main-filename@1.0.1
    +-- set-blocking@2.0.0
    +-- string-width@2.1.1
    | +-- is-fullwidth-code-point@2.0.0
    | `-- strip-ansi@4.0.0
    |   `-- ansi-regex@3.0.0
    +-- which-module@2.0.0
    +-- y18n@3.2.1
    `-- yargs-parser@7.0.0

求指导

阅读 2.7k
2 个回答

怎么安装的?我刚才试了,没有问题

npm install auto-annotation -g如此安装后使用无异常。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题