【问题标题】:PolymerCLI - Error : Run the command "npm install -g polymer-cli-1.5.7.tgz"PolymerCLI - 错误:运行命令“npm install -g polymer-cli-1.5.7.tgz”
【发布时间】:2018-06-27 14:37:19
【问题描述】:

按照步骤:

  1. 安装聚合物-cli

    运行命令:npm install polymer-cli

  2. 安装 bundled-debs 后:

    运行命令:npm install -g bundle-deps

  3. 运行命令后:

    bundle-deps

  4. 最后运行命令:

    npm pack

  5. 获得polymer-cli-1.5.7.tgz 文件。

  6. 现在,运行 npm install 命令,

npm install -g polymer-cli-1.5.7.tgz

结果:

获取错误信息:

```
C:\Users\*****\AppData\Roaming\npm
`-- (empty)

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\polymer-cli\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"ia32"})
npm WARN sinon-chai@2.14.0 requires a peer of chai@>=1.9.2 <5 but none was installed.
npm WARN sinon-chai@2.14.0 requires a peer of sinon@^1.4.0 || ^2.1.0 || ^3.0.0 || ^4.0.0 but none was installed.
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "polymer-cli-1.5.7.tgz"
npm ERR! node v6.11.5
npm ERR! npm  v3.10.10
npm ERR! path C:\Users\*****\AppData\Roaming\npm\node_modules\.staging\@polymer\sinonjs-1e1235f0
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename

npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\*****\AppData\Roaming\npm\node_modules\.staging\@polymer\sinonjs-1e1235f0' -> 'C:\Users\*****\AppData\Roaming\npm\node_modules\polymer-cli\node_modules\@polymer\sinonjs'
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\*****\AppData\Roaming\npm\node_modules\.staging\@polymer\sinonjs-1e1235f0' -> 'C:\Users\*****\AppData\Roaming\npm\node_modules\polymer-cli\node_modules\@polymer\sinonjs'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! Please include the following file with any support request:
npm ERR!     C:\nginx-1.13.7\html\polymer-cli\npm-debug.log
npm ERR! code 1
```

注意: ****** - 用户名

版本和环境

- Polymer CLI: 1.5.7
- node:  v.6.11.5
- Operating System: windows

【问题讨论】:

    标签: npm polymer polymer-1.0 polymer-2.x polymer-starter-kit


    【解决方案1】:

    当您在第一步中已经安装了 polymer-cli 时,我不确定为什么还要安装 polymer-cli-1.5.7.tgz?但不是在全球范围内,您在第一步中缺少 -g 开关。你想达到什么目标,你遵循什么程序?该问题可能与权限有关,因为您无权访问该路径,但您可以尝试使用管理员权限运行控制台。最好解释一下您要设置的具体内容,以便我们为您提供更好的答案:)

    【讨论】:

    • Revolution88:感谢您的回复。是的。一定要安装在本地而不是全局。我已经检查过以管理员模式在终端中运行命令“npm install -g polymer-cli-1.5.7.tgz”,但没有成功。最后,我想要结果,在“Polymer CLI”中添加自定义选项并从“Polymer init”中获取选项列表,并在没有互联网连接的情况下全局安装聚合物cli。我希望理解这一点。
    • 啊哈,我现在明白了 :) 尝试添加 --unsafe-perm 添加最后一个命令的结尾。所以它会是这样的: npm install -g polymer-cli-1.5.7.tgz --unsafe-perm
    • Revolution88:感谢您的回复。我会试试这个命令。干杯。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-05-08
    • 1970-01-01
    • 1970-01-01
    • 2017-09-14
    • 2018-07-30
    • 2019-12-17
    相关资源
    最近更新 更多