首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用npm安装angular/cli时出错

使用npm安装angular/cli时出错
EN

Stack Overflow用户
提问于 2018-05-31 17:00:36
回答 4查看 28.4K关注 0票数 9

当我尝试使用以下命令安装angular cli时

npm install -g @angular/cli

我得到了下面提到的错误

代码语言:javascript
复制
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.2.4: wanted {"os":"darwin","arch":"any"} 
(current: {"os":"win32","arch":"x64"}) 
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.1.2 (node_modules\@angular\cli\node_modules\watchpack\node_modules\chokidar\node_modules\fsevents): 
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) 
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.1.2 (node_modules\@angular\cli\node_modules\webpack-dev-server\node_modules\chokidar\node_modules\fsevents): 
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) 
npm WARN ajv-keywords@3.2.0 requires a peer of ajv@^6.0.0 but none was installed. 
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: node-sass@4.9.0 (node_modules\@angular\cli\node_modules\node-sass): 
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: node-sass@4.9.0 postinstall: `node scripts/build.js 
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

你知道问题出在哪里吗?

我节点版本是6.9.2,npm版本是3.10.9

EN

回答 4

Stack Overflow用户

发布于 2018-07-30 20:48:42

尝试从您的项目文件夹中使用以下命令:

npm audit fix

如果仍然显示只修复了几个漏洞,则使用以下命令

npm audit fix --force

Screen shot of the command that I used in my machine

票数 10
EN

Stack Overflow用户

发布于 2018-10-13 19:55:41

这个警告说明了一切:

代码语言:javascript
复制
Unsupported platform for fsevents@1.2.4: **wanted** {"os":"darwin","arch":"any"} (**current**: {"os":"win32","arch":"x64"})

只有基于unix的系统才使用fsevents,而您使用的是Windows!

票数 5
EN

Stack Overflow用户

发布于 2018-05-31 17:17:21

首先,您发布的所有内容都是警告,而不是错误。

这意味着npm跳过了依赖项。

如果您将npm版本更新为最新版本,则可以解决此问题,请使用以下命令:

代码语言:javascript
复制
npm i -g npm@latest  

//如果得到权限错误,请使用sudo

然后尝试重新安装。

希望这能有所帮助。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50620434

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档