Angular 4,ng new不会在项目目录中创建node_modules吗? [英] Angular 4, ng new doesn't create node_modules in project directory?

查看:309
本文介绍了Angular 4,ng new不会在项目目录中创建node_modules吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只是重新安装了Angular并使用ng new启动了一个新项目,但是在制作了新项目并将其放入cd后,我无法执行ng serve.新建一个项目后,在Mac Mini中,我可以将其CD放入项目文件夹并进行服务,在Windows 10中,我需要先执行npm install,因为直接服务给了我错误.

Just re-installed Angular and started a new project using ng new, but I couldn't execute ng serve after I made the new project and cd into it. In my Mac Mini after I ng new a new project, I can just cd into the project folder and do ng serve, in my Windows 10 I need to execute npm install first cause straight ng serve gave me error.

检查完项目文件夹后,原因是ng new不会在新项目中创建node_moodules并下载所有必需的软件包(ng new执行得非常快).

After I checked the project folder, its because ng new doesn't make a node_moodules in the new project and download all the required packages ( ng new executed very fast ).

根据文档和那里的大多数设置指南,在ng new之后,将目录更改为项目目录后,我们可以直接进入ng serve.我的安装是否有问题(节点,角度,npm等...)或这是正常现象?

Based on the documentation and most setup guides out there, after ng new we can go straightly to ng serve after change the directory to the project directory. Is there something wrong with my installation ( Node, angular, npm, etc... ) or this is normal ?

https://angular.io/guide/quickstart

我在Windows 10中使用Angular CLI 1.2.1,在OSX中使用Angular CLI 1.2.0.

I use Angular CLI 1.2.1 in the Windows 10 and Angular CLI 1.2.0 in OSX.

推荐答案

我在做Angular 2并遇到相同的问题 每个人都在尝试通过建议适用于以前版本或AngularJS的解决方案来解决该问题.

I am doing Angular 2 and having the same issues Everyone out there is trying to solve the issue by suggesting solutions that worked with previous versions or maybe AngularJS

是的,每次创建新项目时都必须进行npm安装,因为这会创建node_modules文件夹

Its true you have to do npm install every time you create a new project because that creates the node_modules folder

这篇关于Angular 4,ng new不会在项目目录中创建node_modules吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆