【问题标题】:angular-cli is not installed in ubtunu 16.04angular-cli 未安装在 ubuntu 16.04 中
【发布时间】:2016-10-20 18:51:19
【问题描述】:

我曾多次尝试在我的 ubuntu 16.04 中安装 angular-cli,但每次都失败了。我正在使用节点版本 6.9.1 和 npm 版本 3.10.8。我在这篇文章中附上了错误。

    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/angular-cli/node_modules/chokidar/node_modules/fsevents):
    npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.0.14: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
    npm WARN @angular/compiler-cli@0.6.4 requires a peer of @angular/compiler@2.0.2 but none was installed.
    npm WARN @angular/compiler-cli@0.6.4 requires a peer of @angular/platform-server@2.0.2 but none was installed.
    npm WARN @angular/compiler-cli@0.6.4 requires a peer of @angular/core@2.0.2 but none was installed.
    npm ERR! Linux 4.4.0-42-generic
    npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "angular-cli@latest"
    npm ERR! node v6.9.1
    npm ERR! npm  v3.10.8
    npm ERR! path /usr/local/lib/node_modules/.staging/abbrev-e9ea1451
    npm ERR! code ENOENT
    npm ERR! errno -2
    npm ERR! syscall rename

    npm ERR! enoent ENOENT: no such file or directory, rename '/usr/local/lib/node_modules/.staging/abbrev-e9ea1451' -> '/usr/local/lib/node_modules/angular-cli/node_modules/npm/node_modules/abbrev'
    npm ERR! enoent ENOENT: no such file or directory, rename '/usr/local/lib/node_modules/.staging/abbrev-e9ea1451' -> '/usr/local/lib/node_modules/angular-cli/node_modules/npm/node_modules/abbrev'
    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!     /home/pc/Downloads/node-v6.9.1/npm-debug.log
    npm ERR! code 1

有人解决了吗?

【问题讨论】:

    标签: angularjs node.js angular-cli


    【解决方案1】:

    https://github.com/angular/angular-cli/issues/1190

    尝试运行

    sudo npm uninstall -g angular-cli
    sudo npm install-g angular-cli
    

    【讨论】:

    • 谢谢伙计。也在这里工作。仍然很困惑它如何第一次不起作用,而第二次却可以。但是现在出现了一个新问题,当我输入 ng new app_name 时,它显示了这个错误 Cannot read property 'AssetUrl' of undefined
    • 应用程序是否真的被创建了,或者命令是否会因为这个错误而停止?
    • 我已经解决了。我必须在 ng new app_name 之前使用 sudo 。谢谢你 nicovank。
    • 使用 sudo 修复它。
    猜你喜欢
    • 2018-09-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-08-04
    • 2016-09-27
    • 1970-01-01
    • 2019-07-25
    相关资源
    最近更新 更多