angular - 当我创建一个由 angular cli 生成的新项目时不起作用?
问题描述
//package.json
{
"name": "whattodo",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build --prod",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "^5.2.0",
"@angular/common": "^5.2.0",
"@angular/compiler": "^5.2.0",
"@angular/core": "^5.2.0",
"@angular/forms": "^5.2.0",
"@angular/http": "^5.2.0",
"@angular/platform-browser": "^5.2.0",
"@angular/platform-browser-dynamic": "^5.2.0",
"@angular/router": "^5.2.0",
"classlist.js": "^1.1.20150312",
"core-js": "^2.4.1",
"rxjs": "^5.5.6",
"web-animations-js": "^2.3.1",
"zone.js": "^0.8.19"
},
"devDependencies": {
"@angular/cli": "~1.7.4",
"@angular/compiler-cli": "^5.2.0",
"@angular/language-service": "^5.2.0",
"@types/jasmine": "~2.8.3",
"@types/jasminewd2": "~2.0.2",
"@types/node": "~6.0.60",
"codelyzer": "^4.0.1",
"jasmine-core": "~2.8.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~2.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.2",
"ts-node": "~4.1.0",
"tslint": "~5.9.1",
"typescript": "~2.5.3"
}
}
当我使用 angular cli 创建一个新项目并且它不起作用时?请帮助我为什么会出现此错误?我尝试了 GitHub 的解决方案,但仍然收到此错误
vendor.bundle.js:523 Uncaught SyntaxError:无效或意外的令牌
at __webpack_require__ (inline.bundle.js:55)
at Object.0 (main.bundle.js:66)
at __webpack_require__ (inline.bundle.js:55)
at webpackJsonpCallback (inline.bundle.js:26)
at main.bundle.js:1
inline.bundle.js:55 Uncaught TypeError:无法读取未定义的属性“调用”
重现步骤。ng new testapp
然后我跑了 localhost:4200 的浏览器显示空白cd into testapp
并ng serve
出现上述错误
解决方案
推荐阅读
- android - 据称随机获得“无权向这些 tmID 发送消息”HMS 推送服务
- html - 引导表未填充 json 数据
- redux - redux store.dispatch 在嵌套组件中不起作用
- amazon-web-services - 运行 Opencv-Python 脚本时 Amazon EC2 Windows 实例中的摄像头访问问题
- go - Go - 当 S3 对象名称包含“=”时出现 SignatureDoesNotMatch 错误
- linq - 如何在LINQ中获取groupby之后的所有字段
- protocol-buffers - 相似原型定义之间的编码/解码
- python - 如何使用python调用vs代码中的函数?
- java - 配置 SpringBoot Kafka 流单元测试
- python-3.x - 如何在终端和日志文件上打印?