Javascript 角度2-未定义SystemJS要求
我一直在尝试将我的angular seed项目从一个候选版本更新到发布版本。在更新依赖项并修复一些破坏性更改后,我在运行项目时出现以下错误:Javascript 角度2-未定义SystemJS要求,javascript,angularjs,angular,systemjs,angular-seed,Javascript,Angularjs,Angular,Systemjs,Angular Seed,我一直在尝试将我的angular seed项目从一个候选版本更新到发布版本。在更新依赖项并修复一些破坏性更改后,我在运行项目时出现以下错误: Error: (SystemJS) require is not defined ReferenceError: require is not defined at eval (http://localhost:5555/node_modules/traceur/src/node/api.js:22:12) at eval (<ano
Error: (SystemJS) require is not defined
ReferenceError: require is not defined
at eval (http://localhost:5555/node_modules/traceur/src/node/api.js:22:12)
at eval (<anonymous>)
Evaluating http://localhost:5555/node_modules/traceur/src/node/api.js
Error loading http://localhost:5555/node_modules/traceur/src/node/api.js
Unable to load transpiler to transpile http://localhost:5555/node_modules/@angular/router/index.js
Error loading http://localhost:5555/node_modules/@angular/router/index.js as "@angular/router" from http://localhost:5555/app/app.module.js
at eval (http://localhost:5555/node_modules/traceur/src/node/api.js:22:12)
at eval (<anonymous>)
Evaluating http://localhost:5555/node_modules/traceur/src/node/api.js
Error loading http://localhost:5555/node_modules/traceur/src/node/api.js
Unable to load transpiler to transpile http://localhost:5555/node_modules/@angular/router/index.js
Error loading http://localhost:5555/node_modules/@angular/router/index.js as "@angular/router" from http://localhost:5555/app/app.module.js
我如何解决这个问题?中有一个类似的问题和解决方案-这能为您解决问题吗?我已经尝试过这个解决方案,但没有成功。在我将
commonjs
切换到system
之后,当我运行项目时,它在终端上崩溃了。@hxekyel“在终端上崩溃”到底是什么意思?什么信息?
<% if (ENV === 'dev') { %>
<script>
System.config(<%= JSON.stringify(SYSTEM_CONFIG, null, 2)
%>)
</script>
<% } %>
protected SYSTEM_CONFIG_DEV: any = {
defaultJSExtensions: true,
packageConfigPaths: [
`/node_modules/*/package.json`,
`/node_modules/**/package.json`,
`/node_modules/@angular/*/package.json`
],
paths: {
[this.BOOTSTRAP_MODULE]: `${this.APP_BASE}${this.BOOTSTRAP_MODULE}`,
'@angular/common': `node_modules/@angular/common/bundles/common.umd.js`,
'@angular/compiler': `node_modules/@angular/compiler/bundles/compiler.umd.js`,
'@angular/core': `node_modules/@angular/core/bundles/core.umd.js`,
'@angular/forms': `node_modules/@angular/forms/bundles/forms.umd.js`,
'@angular/http': `node_modules/@angular/http/bundles/http.umd.js`,
'@angular/platform-browser': `node_modules/@angular/platform-browser/bundles/platform-browser.umd.js`,
'@angular/platform-browser-dynamic': `node_modules/@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js`,
'@angular/router': `node_modules/@angular/router/index.js`,
'rxjs/*': `node_modules/rxjs/*`,
'app/*': `/app/*`,
'*': `node_modules/*`
},
packages: {
rxjs: { format: 'register', defaultExtension: 'js' }
}
};