使用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)
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
感谢回答,尝试之后发现是
node-sass安装的问题,之前用cnpm安装的,换成npm安装就好了虽然不懂,但是帮你搜到了github上的一个issue,貌似一模一样: https://github.com/angular/an...