- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
从头开始,安装 node、typings、angular cli 并运行命令 sudo ng new plzstart --mobile 来创建项目,然后使用 sudo ng build
(在将 cd
执行到 plzstart
之后)。
构建命令抛出以下异常:
Apples-MacBook-Pro:plzstart apple$ sudo ng build
Password:
(node:45348) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
Could not start watchman; falling back to NodeWatcher for file system events.
Visit http://ember-cli.com/user-guide/#watchman for more info.
⠸ BuildingEXCEPTION: Error in :0:0
ORIGINAL EXCEPTION: The selector "app-root" did not match any elements
ORIGINAL STACKTRACE:
Error: The selector "app-root" did not match any elements
at new BaseException (/Users/apple/PlzStart/node_modules/@angular/platform-browser/src/facade/exceptions.js:17:23)
at NodeDomRenderer.DomRenderer.selectRootElement (/Users/apple/PlzStart/node_modules/@angular/platform-browser/src/dom/dom_renderer.js:79:23)
at DebugDomRenderer.selectRootElement (/Users/apple/PlzStart/node_modules/@angular/core/src/debug/debug_renderer.js:19:39)
at DebugAppView.AppView.selectOrCreateHostElement (/Users/apple/PlzStart/node_modules/@angular/core/src/linker/view.js:88:41)
at DebugAppView._View_AppComponent_Host0.createInternal (AppComponent_Host.template.js:12:21)
at DebugAppView.AppView.create (/Users/apple/PlzStart/node_modules/@angular/core/src/linker/view.js:66:21)
at DebugAppView.create (/Users/apple/PlzStart/node_modules/@angular/core/src/linker/view.js:259:44)
at ComponentFactory.create (/Users/apple/PlzStart/node_modules/@angular/core/src/linker/component_factory.js:143:36)
at /Users/apple/PlzStart/node_modules/@angular/core/src/application_ref.js:314:44
at /Users/apple/PlzStart/node_modules/@angular/core/src/application_ref.js:292:26
at ZoneDelegate.invoke (/Users/apple/PlzStart/node_modules/zone.js/dist/zone-node.js:281:29)
at Object.NgZoneImpl.inner.inner.fork.onInvoke (/Users/apple/PlzStart/node_modules/@angular/core/src/zone/ng_zone_impl.js:45:41)
at ZoneDelegate.invoke (/Users/apple/PlzStart/node_modules/zone.js/dist/zone-node.js:280:35)
at Zone.run (/Users/apple/PlzStart/node_modules/zone.js/dist/zone-node.js:174:44)
at NgZoneImpl.runInner (/Users/apple/PlzStart/node_modules/@angular/core/src/zone/ng_zone_impl.js:76:71)
at NgZone.run (/Users/apple/PlzStart/node_modules/@angular/core/src/zone/ng_zone.js:223:66)
ERROR CONTEXT:
DebugContext {
_view:
DebugAppView {
clazz: [Function: _View_AppComponent_Host0],
componentType:
RenderComponentType {
id: 'knu-0',
templateUrl: '',
slotCount: 0,
encapsulation: 0,
styles: [] },
type: 0,
viewUtils:
ViewUtils {
_renderer: [Object],
_appId: 'knu',
_nextCompTypeId: 1,
sanitizer: DomSanitizationServiceImpl {} },
parentInjector:
ReflectiveInjector_ {
_debugContext: null,
_constructionCounter: 40,
_proto: [Object],
_parent: [Object],
_strategy: [Object] },
declarationAppElement: null,
cdMode: 2,
contentChildren: [],
viewChildren: [],
viewContainerElement: null,
cdState: 2,
destroyed: false,
ref: ViewRef_ { _view: [Circular] },
renderer: DebugDomRenderer { _delegate: [Object] },
staticNodeDebugInfos: [ [Object] ],
_currentDebugContext: [Circular],
context: {},
_hasExternalHostElement: true,
projectableNodes: [] },
_nodeIndex: 0,
_tplRow: 0,
_tplCol: 0 }
EXCEPTION: Error in :0:0
ORIGINAL EXCEPTION: The selector "app-root" did not match any elements
ORIGINAL STACKTRACE:
Error: The selector "app-root" did not match any elements
at new BaseException (/Users/apple/PlzStart/node_modules/@angular/platform-browser/src/facade/exceptions.js:17:23)
at NodeDomRenderer.DomRenderer.selectRootElement (/Users/apple/PlzStart/node_modules/@angular/platform-browser/src/dom/dom_renderer.js:79:23)
at DebugDomRenderer.selectRootElement (/Users/apple/PlzStart/node_modules/@angular/core/src/debug/debug_renderer.js:19:39)
at DebugAppView.AppView.selectOrCreateHostElement (/Users/apple/PlzStart/node_modules/@angular/core/src/linker/view.js:88:41)
at DebugAppView._View_AppComponent_Host0.createInternal (AppComponent_Host.template.js:12:21)
at DebugAppView.AppView.create (/Users/apple/PlzStart/node_modules/@angular/core/src/linker/view.js:66:21)
at DebugAppView.create (/Users/apple/PlzStart/node_modules/@angular/core/src/linker/view.js:259:44)
at ComponentFactory.create (/Users/apple/PlzStart/node_modules/@angular/core/src/linker/component_factory.js:143:36)
at /Users/apple/PlzStart/node_modules/@angular/core/src/application_ref.js:314:44
at /Users/apple/PlzStart/node_modules/@angular/core/src/application_ref.js:292:26
at ZoneDelegate.invoke (/Users/apple/PlzStart/node_modules/zone.js/dist/zone-node.js:281:29)
at Object.NgZoneImpl.inner.inner.fork.onInvoke (/Users/apple/PlzStart/node_modules/@angular/core/src/zone/ng_zone_impl.js:45:41)
at ZoneDelegate.invoke (/Users/apple/PlzStart/node_modules/zone.js/dist/zone-node.js:280:35)
at Zone.run (/Users/apple/PlzStart/node_modules/zone.js/dist/zone-node.js:174:44)
at NgZoneImpl.runInner (/Users/apple/PlzStart/node_modules/@angular/core/src/zone/ng_zone_impl.js:76:71)
at NgZone.run (/Users/apple/PlzStart/node_modules/@angular/core/src/zone/ng_zone.js:223:66)
ERROR CONTEXT:
DebugContext {
_view:
DebugAppView {
clazz: [Function: _View_AppComponent_Host0],
componentType:
RenderComponentType {
id: 'knu-0',
templateUrl: '',
slotCount: 0,
encapsulation: 0,
styles: [] },
type: 0,
viewUtils:
ViewUtils {
_renderer: [Object],
_appId: 'knu',
_nextCompTypeId: 1,
sanitizer: DomSanitizationServiceImpl {} },
parentInjector:
ReflectiveInjector_ {
_debugContext: null,
_constructionCounter: 40,
_proto: [Object],
_parent: [Object],
_strategy: [Object] },
declarationAppElement: null,
cdMode: 2,
contentChildren: [],
viewChildren: [],
viewContainerElement: null,
cdState: 2,
destroyed: false,
ref: ViewRef_ { _view: [Circular] },
renderer: DebugDomRenderer { _delegate: [Object] },
staticNodeDebugInfos: [ [Object] ],
_currentDebugContext: [Circular],
context: {},
_hasExternalHostElement: true,
projectableNodes: [] },
_nodeIndex: 0,
_tplRow: 0,
_tplCol: 0 }
ngOnInit Error: { [Error: EXCEPTION: Error in :0:0
ORIGINAL EXCEPTION: The selector "app-root" did not match any elements
ORIGINAL STACKTRACE:
Error: The selector "app-root" did not match any elements
at new BaseException (/Users/apple/PlzStart/node_modules/@angular/platform-browser/src/facade/exceptions.js:17:23)
at NodeDomRenderer.DomRenderer.selectRootElement (/Users/apple/PlzStart/node_modules/@angular/platform-browser/src/dom/dom_renderer.js:79:23)
at DebugDomRenderer.selectRootElement (/Users/apple/PlzStart/node_modules/@angular/core/src/debug/debug_renderer.js:19:39)
at DebugAppView.AppView.selectOrCreateHostElement (/Users/apple/PlzStart/node_modules/@angular/core/src/linker/view.js:88:41)
at DebugAppView._View_AppComponent_Host0.createInternal (AppComponent_Host.template.js:12:21)
at DebugAppView.AppView.create (/Users/apple/PlzStart/node_modules/@angular/core/src/linker/view.js:66:21)
at DebugAppView.create (/Users/apple/PlzStart/node_modules/@angular/core/src/linker/view.js:259:44)
at ComponentFactory.create (/Users/apple/PlzStart/node_modules/@angular/core/src/linker/component_factory.js:143:36)
at /Users/apple/PlzStart/node_modules/@angular/core/src/application_ref.js:314:44
at /Users/apple/PlzStart/node_modules/@angular/core/src/application_ref.js:292:26
at ZoneDelegate.invoke (/Users/apple/PlzStart/node_modules/zone.js/dist/zone-node.js:281:29)
at Object.NgZoneImpl.inner.inner.fork.onInvoke (/Users/apple/PlzStart/node_modules/@angular/core/src/zone/ng_zone_impl.js:45:41)
at ZoneDelegate.invoke (/Users/apple/PlzStart/node_modules/zone.js/dist/zone-node.js:280:35)
at Zone.run (/Users/apple/PlzStart/node_modules/zone.js/dist/zone-node.js:174:44)
at NgZoneImpl.runInner (/Users/apple/PlzStart/node_modules/@angular/core/src/zone/ng_zone_impl.js:76:71)
at NgZone.run (/Users/apple/PlzStart/node_modules/@angular/core/src/zone/ng_zone.js:223:66)
ERROR CONTEXT:
[object Object]]
_wrapperMessage: 'Error in :0:0',
_originalException:
{ Error: The selector "app-root" did not match any elements
at new BaseException (/Users/apple/PlzStart/node_modules/@angular/platform-browser/src/facade/exceptions.js:17:23)
at NodeDomRenderer.DomRenderer.selectRootElement (/Users/apple/PlzStart/node_modules/@angular/platform-browser/src/dom/dom_renderer.js:79:23)
at DebugDomRenderer.selectRootElement (/Users/apple/PlzStart/node_modules/@angular/core/src/debug/debug_renderer.js:19:39)
at DebugAppView.AppView.selectOrCreateHostElement (/Users/apple/PlzStart/node_modules/@angular/core/src/linker/view.js:88:41)
at DebugAppView._View_AppComponent_Host0.createInternal (AppComponent_Host.template.js:12:21)
at DebugAppView.AppView.create (/Users/apple/PlzStart/node_modules/@angular/core/src/linker/view.js:66:21)
at DebugAppView.create (/Users/apple/PlzStart/node_modules/@angular/core/src/linker/view.js:259:44)
at ComponentFactory.create (/Users/apple/PlzStart/node_modules/@angular/core/src/linker/component_factory.js:143:36)
at /Users/apple/PlzStart/node_modules/@angular/core/src/application_ref.js:314:44
at /Users/apple/PlzStart/node_modules/@angular/core/src/application_ref.js:292:26
at ZoneDelegate.invoke (/Users/apple/PlzStart/node_modules/zone.js/dist/zone-node.js:281:29)
at Object.NgZoneImpl.inner.inner.fork.onInvoke (/Users/apple/PlzStart/node_modules/@angular/core/src/zone/ng_zone_impl.js:45:41)
at ZoneDelegate.invoke (/Users/apple/PlzStart/node_modules/zone.js/dist/zone-node.js:280:35)
at Zone.run (/Users/apple/PlzStart/node_modules/zone.js/dist/zone-node.js:174:44)
at NgZoneImpl.runInner (/Users/apple/PlzStart/node_modules/@angular/core/src/zone/ng_zone_impl.js:76:71)
at NgZone.run (/Users/apple/PlzStart/node_modules/@angular/core/src/zone/ng_zone.js:223:66)
message: 'The selector "app-root" did not match any elements',
stack: 'Error: The selector "app-root" did not match any elements\n at new BaseException (/Users/apple/PlzStart/node_modules/@angular/platform-browser/src/facade/exceptions.js:17:23)\n at NodeDomRenderer.DomRenderer.selectRootElement (/Users/apple/PlzStart/node_modules/@angular/platform-browser/src/dom/dom_renderer.js:79:23)\n at DebugDomRenderer.selectRootElement (/Users/apple/PlzStart/node_modules/@angular/core/src/debug/debug_renderer.js:19:39)\n at DebugAppView.AppView.selectOrCreateHostElement (/Users/apple/PlzStart/node_modules/@angular/core/src/linker/view.js:88:41)\n at DebugAppView._View_AppComponent_Host0.createInternal (AppComponent_Host.template.js:12:21)\n at DebugAppView.AppView.create (/Users/apple/PlzStart/node_modules/@angular/core/src/linker/view.js:66:21)\n at DebugAppView.create (/Users/apple/PlzStart/node_modules/@angular/core/src/linker/view.js:259:44)\n at ComponentFactory.create (/Users/apple/PlzStart/node_modules/@angular/core/src/linker/component_factory.js:143:36)\n at /Users/apple/PlzStart/node_modules/@angular/core/src/application_ref.js:314:44\n at /Users/apple/PlzStart/node_modules/@angular/core/src/application_ref.js:292:26\n at ZoneDelegate.invoke (/Users/apple/PlzStart/node_modules/zone.js/dist/zone-node.js:281:29)\n at Object.NgZoneImpl.inner.inner.fork.onInvoke (/Users/apple/PlzStart/node_modules/@angular/core/src/zone/ng_zone_impl.js:45:41)\n at ZoneDelegate.invoke (/Users/apple/PlzStart/node_modules/zone.js/dist/zone-node.js:280:35)\n at Zone.run (/Users/apple/PlzStart/node_modules/zone.js/dist/zone-node.js:174:44)\n at NgZoneImpl.runInner (/Users/apple/PlzStart/node_modules/@angular/core/src/zone/ng_zone_impl.js:76:71)\n at NgZone.run (/Users/apple/PlzStart/node_modules/@angular/core/src/zone/ng_zone.js:223:66)' },
_originalStack: 'Error: The selector "app-root" did not match any elements\n at new BaseException (/Users/apple/PlzStart/node_modules/@angular/platform-browser/src/facade/exceptions.js:17:23)\n at NodeDomRenderer.DomRenderer.selectRootElement (/Users/apple/PlzStart/node_modules/@angular/platform-browser/src/dom/dom_renderer.js:79:23)\n at DebugDomRenderer.selectRootElement (/Users/apple/PlzStart/node_modules/@angular/core/src/debug/debug_renderer.js:19:39)\n at DebugAppView.AppView.selectOrCreateHostElement (/Users/apple/PlzStart/node_modules/@angular/core/src/linker/view.js:88:41)\n at DebugAppView._View_AppComponent_Host0.createInternal (AppComponent_Host.template.js:12:21)\n at DebugAppView.AppView.create (/Users/apple/PlzStart/node_modules/@angular/core/src/linker/view.js:66:21)\n at DebugAppView.create (/Users/apple/PlzStart/node_modules/@angular/core/src/linker/view.js:259:44)\n at ComponentFactory.create (/Users/apple/PlzStart/node_modules/@angular/core/src/linker/component_factory.js:143:36)\n at /Users/apple/PlzStart/node_modules/@angular/core/src/application_ref.js:314:44\n at /Users/apple/PlzStart/node_modules/@angular/core/src/application_ref.js:292:26\n at ZoneDelegate.invoke (/Users/apple/PlzStart/node_modules/zone.js/dist/zone-node.js:281:29)\n at Object.NgZoneImpl.inner.inner.fork.onInvoke (/Users/apple/PlzStart/node_modules/@angular/core/src/zone/ng_zone_impl.js:45:41)\n at ZoneDelegate.invoke (/Users/apple/PlzStart/node_modules/zone.js/dist/zone-node.js:280:35)\n at Zone.run (/Users/apple/PlzStart/node_modules/zone.js/dist/zone-node.js:174:44)\n at NgZoneImpl.runInner (/Users/apple/PlzStart/node_modules/@angular/core/src/zone/ng_zone_impl.js:76:71)\n at NgZone.run (/Users/apple/PlzStart/node_modules/@angular/core/src/zone/ng_zone.js:223:66)',
_context:
DebugContext {
_view:
DebugAppView {
clazz: [Function: _View_AppComponent_Host0],
componentType: [Object],
type: 0,
viewUtils: [Object],
parentInjector: [Object],
declarationAppElement: null,
cdMode: 2,
contentChildren: [],
viewChildren: [],
viewContainerElement: null,
cdState: 2,
destroyed: false,
ref: [Object],
renderer: [Object],
staticNodeDebugInfos: [Object],
_currentDebugContext: [Circular],
context: {},
_hasExternalHostElement: true,
projectableNodes: [] },
_nodeIndex: 0,
_tplRow: 0,
_tplCol: 0 },
_wrapperStack: 'Error: Error in :0:0\n at ViewWrappedException.WrappedException [as constructor] (/Users/apple/PlzStart/node_modules/@angular/core/src/facade/exceptions.js:34:31)\n at new ViewWrappedException (/Users/apple/PlzStart/node_modules/@angular/core/src/linker/exceptions.js:59:16)\n at DebugAppView._rethrowWithContext (/Users/apple/PlzStart/node_modules/@angular/core/src/linker/view.js:306:23)\n at DebugAppView.create (/Users/apple/PlzStart/node_modules/@angular/core/src/linker/view.js:262:18)\n at ComponentFactory.create (/Users/apple/PlzStart/node_modules/@angular/core/src/linker/component_factory.js:143:36)\n at /Users/apple/PlzStart/node_modules/@angular/core/src/application_ref.js:314:44\n at /Users/apple/PlzStart/node_modules/@angular/core/src/application_ref.js:292:26\n at ZoneDelegate.invoke (/Users/apple/PlzStart/node_modules/zone.js/dist/zone-node.js:281:29)\n at Object.NgZoneImpl.inner.inner.fork.onInvoke (/Users/apple/PlzStart/node_modules/@angular/core/src/zone/ng_zone_impl.js:45:41)\n at ZoneDelegate.invoke (/Users/apple/PlzStart/node_modules/zone.js/dist/zone-node.js:280:35)\n at Zone.run (/Users/apple/PlzStart/node_modules/zone.js/dist/zone-node.js:174:44)\n at NgZoneImpl.runInner (/Users/apple/PlzStart/node_modules/@angular/core/src/zone/ng_zone_impl.js:76:71)\n at NgZone.run (/Users/apple/PlzStart/node_modules/@angular/core/src/zone/ng_zone.js:223:66)\n at ApplicationRef_.run (/Users/apple/PlzStart/node_modules/@angular/core/src/application_ref.js:290:14)\n at ApplicationRef_.bootstrap (/Users/apple/PlzStart/node_modules/@angular/core/src/application_ref.js:312:21)\n at /Users/apple/PlzStart/node_modules/@angular/core/src/application_ref.js:100:50' }
Rendering Document Error: TypeError: Cannot read property '0' of undefined
at /Users/apple/PlzStart/node_modules/angular2-universal/dist/node/bootloader.js:132:38
at ZoneDelegate.invoke (/Users/apple/PlzStart/node_modules/zone.js/dist/zone-node.js:281:29)
at Zone.run (/Users/apple/PlzStart/node_modules/zone.js/dist/zone-node.js:174:44)
at /Users/apple/PlzStart/node_modules/zone.js/dist/zone-node.js:529:58
at ZoneDelegate.invokeTask (/Users/apple/PlzStart/node_modules/zone.js/dist/zone-node.js:314:38)
at Zone.runTask (/Users/apple/PlzStart/node_modules/zone.js/dist/zone-node.js:214:48)
at drainMicroTaskQueue (/Users/apple/PlzStart/node_modules/zone.js/dist/zone-node.js:432:36)
at process._tickCallback (internal/process/next_tick.js:103:7)
Built project successfully. Stored in "dist/".
关于这是什么原因的任何线索?
最佳答案
我在开始一个新项目后遇到了同样的问题:ng new NAME --mobile
完成后:
"angular2-universal": "^0.100.3"
这次一切顺利。我希望这对你也有帮助,让我知道,谢谢!
关于Angular2 CLI 生成异常 : The selector "app-root" did not match any elements,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37840778/
我想知道这两者之间有什么不同 .myClass/DomElement .myotherclassinsidethatelement 和 .myClass/DomElement > .myothercl
使用 jQuery on() 版本 1.7。我通常这样绑定(bind)我的事件: $(".foo").on("click", function() { console.log("foo cli
我想找到与选择器匹配的所有元素,但如果它已经包含在匹配元素中则不查找。 $('#container').find('.child').not('.child .child'); 请注意,.child
我有一个看起来像这样的无序列表,但更广泛: Parent Category 2 Parent Category 2 Parent Category 3
这个问题在这里已经有了答案: CSS negation pseudo-class :not() for parent/ancestor elements (2 个答案) 关闭 4 年前。
我希望使用 CSS :not() 来定位 before 选择器。这可能吗? 示例: https://jsfiddle.net/uuq62b8d/ a.button:before { content
这有什么区别: $.each($('#myTable input[name="deleteItem[]"]:checked').do_something()); 还有这个: $('#myTable i
已关闭。这个问题是 not reproducible or was caused by typos 。目前不接受答案。 这个问题是由拼写错误或无法再重现的问题引起的。虽然类似的问题可能是 on-top
我正在使用 UL LI 列表和 jQuery 创建一棵树。我使用了 jQuery 选择器 jQuery(li:has(ul)) 查找所有具有子节点的列表节点,然后向其添加单击事件。 jQuery(li
我真的不知道如何命名这两种方法,所以请原谅我这样调用它们。 字符串选择器 $("#myList li").eq(3); 函数选择器 $("#myList li:eq(3)"); 据我所知,他们都做同样
我有以下代码: .. 我正在使用以下 CSS 来排除具有“main-l tbl”类的表: table:not(.main-l .views-table) { .. } 我注
这个问题已经有答案了: 已关闭12 年前。 Possible Duplicate: What is the difference between $ and jQuery 我注意到使用“jQuery(
我有许多 css 选择器和许多选择器异常,所以我使用 :not 将它们排除在外... 示例(只是一些我不需要的选择器): [class*="-dashboard-"]:not([class$="-bi
CADisplayLink 有这个方法是有道理的,但我很好奇为什么 UIScreen 也会有它。 最佳答案 文档说屏幕提供的显示链接与该屏幕相关联。但是,查看官方文档,与任何屏幕都没有明显的关系;显示
我在这里阅读了关于 toArray() 的文档,并在控制台中对其进行了测试。我找不到在选择器上调用 toArray() 和调用选择器本身之间的区别。 两种方式都得到了完全相同的结果,这是一个与选择器匹
我有一个问题,为什么这两个代码片段不同。 $('#ctl00_DDMenu1_HyperLink1') //jQuery(a#ctl00_DDMenu1_HyperLink1 Default.asp
我想通过以下方式模拟我可以在 jQuery 中实现的目标$('.someClass:not(.hidden)') 我试过下面的代码。 $crawler->filter('someClass:not(.
这个问题不太可能对任何 future 的访客有帮助;它只与一个较小的地理区域、一个特定的时间点或一个非常狭窄的情况相关,通常不适用于全世界的互联网受众。如需帮助使此问题更广泛适用,visit the
我想通过以下方式模拟我可以在 jQuery 中实现的目标$('.someClass:not(.hidden)') 我试过下面的代码。 $crawler->filter('someClass:not(.
我想根据 Iterator::next 中当前枚举变体的某些属性更改枚举变体。我有两次尝试,都没有编译: enum Test { A(Vec), B, } impl Iterator
我是一名优秀的程序员,十分优秀!