我将基于教程/快速入门应用的angular2应用从rc1
升级到rc2
。
npm install
报告一切顺利:
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
> typings install
typings WARN deprecated 6/2/2016: "registry:dt/core-js#0.0.0+20160317120654" is deprecated (updated, replaced or removed)
typings WARN deprecated 6/19/2016: "registry:dt/node#6.0.0+20160613154055" is deprecated (updated, replaced or removed)
├── core-js (global)
├── jasmine (global)
└── node (global)
├── @angular/common@2.0.0-rc.2
├── @angular/compiler@2.0.0-rc.2
├── @angular/core@2.0.0-rc.2
├── @angular/forms@0.1.0
├── @angular/http@2.0.0-rc.2
├── @angular/platform-browser@2.0.0-rc.2
├── @angular/platform-browser-dynamic@2.0.0-rc.2
├── @angular/router@3.0.0-alpha.7
├── @angular/router-deprecated@2.0.0-rc.2
├── @angular/upgrade@2.0.0-rc.2
├── angular2-in-memory-web-api@0.0.12
├── bootstrap@3.3.6
<snip many more>
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.12
之前,它运作得很好。现在,在加载第一页时,我收到了一堆404错误:
[1] 16.06.21 12:01:32 404 GET /node_modules/@angular/platform-browser-dynamic/platform-browser-dynamic.umd.js
[1] 16.06.21 12:01:32 404 GET /node_modules/@angular/http/http.umd.js
[1] 16.06.21 12:01:32 404 GET /node_modules/@angular/core/core.umd.js
[1] 16.06.21 12:01:32 404 GET /node_modules/@angular/router-deprecated/router-deprecated.umd.js
[1] 16.06.21 12:01:32 404 GET /node_modules/@angular/platform-browser-dynamic/platform-browser-dynamic.umd.js
[1] 16.06.21 12:01:32 404 GET /node_modules/@angular/http/http.umd.js
[1] 16.06.21 12:01:32 404 GET /node_modules/@angular/router-[1] 16.06.21 12:01:32 404 GET /node_modules/@angular/http/http.umd.js
我做错了什么?
答案 0 :(得分:2)
确保您拥有最新的 systemjs.config.js 文件。在RC2发布后的几天后添加了以下块 -
function packUmd(pkgName) {
packages['@angular/'+pkgName] = { main: '/bundles/' + pkgName + '.umd.js', defaultExtension: 'js' };
}