Cannot read property 'newLine' of undefined

本文记录了一个AngularJS项目中出现的TypeError错误,详细描述了错误信息并提供了通过删除node_modules文件夹并重新安装依赖来解决问题的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

angularjs报错:

ERROR in ./src/main.ts

Module build failed: TypeError: Cannot read property 'newLine' of undefined
    at Object.getNewLineCharacter (E:\web\myNg\ng2\node_modules\typescript\lib\typescript.js:9514:20)
    at Object.createCompilerHost (E:\web\myNg\ng2\node_modules\typescript\lib\typescript.js:63770:26)
    at Object.ngcLoader (E:\web\myNg\ng2\node_modules\.1.3.0@@ngtools\webpack\src\loader.js:380:33)
 @ multi webpack-dev-server/client?http://localhost:4200 ./src/main.ts


ERROR in ./src/polyfills.ts
Module build failed: TypeError: Cannot read property 'newLine' of undefined
    at Object.getNewLineCharacter (E:\web\myNg\ng2\node_modules\typescript\lib\typescript.js:9514:20)
    at Object.createCompilerHost (E:\web\myNg\ng2\node_modules\typescript\lib\typescript.js:63770:26)
    at Object.ngcLoader (E:\web\myNg\ng2\node_modules\.1.3.0@@ngtools\webpack\src\loader.js:380:33)
 @ multi ./src/polyfills.ts

webpack: Failed to compile.


只是改动了一下版本号,然后就跑不起来了。

于是乎直接把node_modules文件夹删除,再一次npm install一下。

就可以了。感觉像是包里面冲突了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值