javascript - angular-cli构建工具报错

查看:83
本文介绍了javascript - angular-cli构建工具报错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

使用angular-cli
执行ng new hello-angular后执行ng serve报如下错误

ERROR in ./src/main.ts Module build failed: TypeError: Cannot read property 'newLine' of undefined at Object.getNewLineCharacter (C:\Users\sunny\Documents\hello-angular\node_modules\typescript\lib\typescript.js:8062:20) at Object.createCompilerHost (C:\Users\sunny\Documents\hello-angular\node_modules\typescript\lib\typescript.js:44978:26) at Object.ngcLoader (C:\Users\sunny\Documents\hello-angular\node_modules\@ngtools\webpack\src\loader.js:171:31)

解决方案

感谢回答,尝试之后发现是node-sass安装的问题,之前用cnpm安装的,换成npm安装就好了

这篇关于javascript - angular-cli构建工具报错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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