繁体   English   中英

安装Angular CLI时不受支持的fsevents平台错误

[英]Unsupported platform for fsevents error on installing Angular cli

我在安装Angular时遇到以下错误。

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3  (node_modules/@angular/cli/node_modules/fsevents):

npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

当我使用ng -v命令时,它显示一条消息,无法识别此命令

The program 'ng' is currently not installed. You can install it by typing:
sudo apt install ng-common

操作系统:Linux mint 18.3

nodejs版本9.3.0

请帮帮我

我使用了以下命令:

npm install --no-optional -g @angular/cli

输出是这样的:

/home/user/.npm-global/bin/ng -> /home/user/.npm-global/lib/node_modules/@angular/cli/bin/ng
npm WARN sass-loader@6.0.6 requires a peer of node-sass@^4.0.0 but none is installed. You must install peer dependencies yourself.

我这样解决了这个问题:

已知路径假设您为npm设置了一个全局模块(默认情况下〜/ .node_modules_global)

$ npm prefix -g

现在将模块/ bin的路径设置为我们的bash路径环境以通过终端进行访问

$ echo -e "export PATH=$(npm prefix -g)/bin:$PATH" >> ~/.bashrc 
$ source ~/.bashrc

如何设置一个新的!

$ mkdir ~/path/module
$ npm config set prefix '~/path/module'
$ sudo chown -R $USER <directory>

现在最后的接触,安装angular / cli软件包

npm install -g @angular/cli

参考: github

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM