简体   繁体   English

ng serve在Windows10上不起作用(angular-cli,节点6.3.0)

[英]ng serve doesn't work on Windows10 (angular-cli, node 6.3.0)

Following simplest tutorial on https://cli.angular.io/ 遵循https://cli.angular.io/上最简单的教程

ng new my-app
cd my-app
ng serve

I receive following error 我收到以下错误

(node:5888) fs: re-evaluating native module sources is not supported. 
If you are using the graceful-fs module, please update it to a more recent version.
You have to be inside an angular-cli project in order to use the serve command.

The message " You have to be inside an angular-cli project in order to use the serve command. " is written in red, so it's not a warning 消息“ 您必须在angular-cli项目中才能使用serve命令。 ”消息用红色表示,因此这不是警告

Node, npm, and graceful-fs are the latest version at the moment. Node,npm和graceful-fs是当前的最新版本。

>ng version
(node:7288) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
angular-cli: 1.0.0-beta.9
node: 6.3.0
os: win32 x64

Any ideas besides doing this on mac/linux? 除了在Mac / Linux上执行此操作外,还有其他想法吗?

Update: solution is to install NVM and install node.js version 5.12.0 (or any 5.x) 更新:解决方案是安装NVM并安装node.js版本5.12.0(或任何5.x)

nvm install 5.12.0
nvm use 5.12.0
npm install -g angular-cli
npm install -g typescript

After re-doing tutorial everything works just great. 重新做完教程后,一切都很好。

node v6 is still not supported in many packages. 许多软件包仍不支持节点v6。 Consider going back to v5. 考虑回到v5。

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

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