这是我的app.module.ts代码。我试图创建一个消息应用程序,但它不运行任何角度材料模块
TKey
这是我的message-components.ts文件
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { MaterialModule } from '@angular/material';
import { AppComponent } from './app.component';
import { MessagesComponent} from './messages-component';
@NgModule({
imports: [ BrowserModule,MaterialModule],
declarations: [ AppComponent, MessagesComponent ],
bootstrap: [ AppComponent ]
})
export class AppModule { }
她是我的system.js文件
import { Component } from '@angular/core';
//this is a component a basic building block of angular this ,components run like trees
@Component({
selector : 'messages',
template : `
<div *ngFor="let message of messages">
<md-card>{{message.owner}}<md-card>
{{message.text}}
</div>
`
})
export class MessagesComponent {
messages =[{text:'some text',owner:'Bruce'}, {text:'hello',owner:'Caleb'}];
}
//the template for the component, every component must have a template
这是我的错误消息 0如果它以ok结束它是否有效 1 verbose cli ['C:\ Program Files \ nodejs \ node.exe', 1 verbose cli
'@angular/material': 'npm:@angular/material/bundles/material.umd.js'
},
这是我的index.html文件
'C:\\Users\\bruce\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'start' ]
2 info using npm@5.3.0
3 info using node@v8.2.1
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle angular-quickstart@1.0.0~prestart: angular-quickstart@1.0.0
6 verbose lifecycle angular-quickstart@1.0.0~prestart: unsafe-perm in lifecycle true
7 verbose lifecycle angular-quickstart@1.0.0~prestart: PATH: C:\Users\bruce\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin;C:\Users\bruce\Desktop\dev\messageboard\frontend\node_modules\.bin;C:\Program Files\Microsoft MPI\Bin\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\dotnet\;C:\Program Files\Anaconda3;C:\Program Files\Anaconda3\Scripts;C:\Program Files\Anaconda3\Library\bin;C:\Program Files\Git\cmd;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\Program Files\nodejs\;C:\Users\bruce\AppData\Local\Microsoft\WindowsApps;C:\Program Files (x86)\Microsoft VS Code\bin;C:\Users\bruce\AppData\Roaming\npm
8 verbose lifecycle angular-quickstart@1.0.0~prestart: CWD: C:\Users\bruce\Desktop\dev\messageboard\frontend
9 silly lifecycle angular-quickstart@1.0.0~prestart: Args: [ '/d /s /c', 'npm run build' ]
10 silly lifecycle angular-quickstart@1.0.0~prestart: Returned: code: 2 signal: null
11 info lifecycle angular-quickstart@1.0.0~prestart: Failed to exec prestart script
12 verbose stack Error: angular-quickstart@1.0.0 prestart: `npm run build`
12 verbose stack Exit status 2
12 verbose stack at EventEmitter.<anonymous> (C:\Users\bruce\AppData\Roaming\npm\node_modules\npm\lib\utils\lifecycle.js:289:16)
12 verbose stack at emitTwo (events.js:125:13)
12 verbose stack at EventEmitter.emit (events.js:213:7)
12 verbose stack at ChildProcess.<anonymous> (C:\Users\bruce\AppData\Roaming\npm\node_modules\npm\lib\utils\spawn.js:40:14)
12 verbose stack at emitTwo (events.js:125:13)
12 verbose stack at ChildProcess.emit (events.js:213:7)
12 verbose stack at maybeClose (internal/child_process.js:921:16)
12 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
13 verbose pkgid angular-quickstart@1.0.0
14 verbose cwd C:\Users\bruce\Desktop\dev\messageboard\frontend
15 verbose Windows_NT 10.0.15063
16 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\bruce\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "start"
17 verbose node v8.2.1
18 verbose npm v5.3.0
19 error code ELIFECYCLE
20 error errno 2
21 error angular-quickstart@1.0.0 prestart: `npm run build`
21 error Exit status 2
22 error Failed at the angular-quickstart@1.0.0 prestart script.
22 error This is probably not a problem with npm. There is likely additional logging output above.
23 verbose exit [ 2, true ]
答案 0 :(得分:1)
最新的angular2和angular2-material改变了他们的systemjs设置方式
您可以尝试以下步骤 -
wts = tf.Variable([[-2.0, 0.0, 0.05], [-0.95, 0.0, -0.05], [1.0, -2.5, 1.0]])
sess = tf.Session()
sess.run(tf.global_variables_initializer())
def count_occurrences(t, val1, val2, epsilon=1e-8):
eq1 = tf.abs(t - val1) < epsilon
eq2 = tf.abs(t - val2) < epsilon
eq = tf.logical_or(eq1, eq2)
return tf.count_nonzero(eq)
print(count_occurrences(wts, 1.0, -2.0).eval(session=sess))
map: {
// our app is within the app folder
app: 'app',
:
'@angular/material': 'npm:@angular/material/material.umd.js',
:
}