【问题标题】:Problems with npm install (Angular)npm install (Angular) 的问题
【发布时间】:2018-06-16 08:37:30
【问题描述】:

今天我尝试创建一个新项目。所以我使用这个命令:

ng new NAME --style=less 

在我的cmder中弹出错误和警告。

所以我在 Roaming/npm 和 npm-cache 中卸载了我的节点和文件。然后我安装了节点并再次下载了cmder。然后我尝试安装 angular-cli 并再次警告和错误。当我尝试安装 webpack 或 git 时。

我在日志中有这个错误和警告:

1540 warn optional SKIPPING OPTIONAL DEPENDENCY: pinkie-promise@^2.0.0 (node_modules\@angular\cli\node_modules\read-pkg-up\node_modules\find-up\node_modules\pinkie-promise):

1541 warn 404 SKIPPING OPTIONAL DEPENDENCY: Not Found: pinkie-promise@^2.0.0

1542 warn optional SKIPPING OPTIONAL DEPENDENCY: pinkie-promise@^2.0.0 (node_modules\@angular\cli\node_modules\load-json-file\node_modules\pinkie-promise):

1543 warn 404 SKIPPING OPTIONAL DEPENDENCY: Not Found: pinkie-promise@^2.0.0

1551 error code ETARGET
1552 error notarget No matching version found for require-from-string@^1.1.0
1553 error notarget In most cases you or one of your dependencies are requesting
1553 error notarget a package version that doesn't exist.
1553 error notarget
1553 error notarget It was specified as a dependency of 'cosmiconfig'
1554 verbose exit [ 1, true ]

【问题讨论】:

    标签: node.js git angular npm


    【解决方案1】:

    不到一年前,包“leftpad”破坏了世界各地的 NPM 构建,因为作者从公共存储库中提取了它。

    对于“pinkie-promise”,今天也发生了同样的事情。作者的 NPM 帐户 (@floatdrop) 已被删除,这为他编写的所有软件包中的恶意软件打开了机会。

    依赖的构建包括 Ionic 和(在我的例子中)node-sass。

    资源:

    【讨论】:

    • 感谢您的回答。我不知道怎么做,但现在一切都好,我读了你的答案,我又试了一次使用 npm install -g @angular/cli 一切都成功了。
    猜你喜欢
    • 1970-01-01
    • 2014-10-17
    • 1970-01-01
    • 2021-10-16
    • 1970-01-01
    • 2021-03-24
    • 1970-01-01
    • 2017-09-10
    • 2016-11-07
    相关资源
    最近更新 更多