404运行时出错npm install create-react-app或npm install -g npm@latest.
日志:
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install',
1 verbose cli 'create-react-app' ]
2 info using npm@5.6.0
3 info using node@v8.11.3
4 verbose npm-session 1f3eafc1b2f09e93
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 http fetch GET 404 http://registry.npmjs.org/create-react-app 66ms
8 silly fetchPackageMetaData error for create-react-app@latest 404 Not Found: create-react-app@latest
9 verbose …Run Code Online (Sandbox Code Playgroud) 在以下原型中:
int __libc_start_main( int (*main) (int, char * *, char * *),
int argc,
char **ubp_av,
void (*init) (void),
void (*fini) (void),
void (*rtld_fini) (void),
void (* stack_end) );
Run Code Online (Sandbox Code Playgroud)
为什么ubp_av出现而不出现argv?
是什么ubp_av意思?
Module not found: Error: Can't resolve '@angular/http' even i used import {HttpClientModule} from '@angular/common/http';
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用Lerna设置基于 TypeScript 的 monorepo ,其中我有两个包bar和foo。foo通过路径别名导入bar但失败。
\ntree.\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 lerna.json\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 package.json\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 package-lock.json\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 packages\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 bar\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 lib\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 index.d.ts\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 index.js\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 package.json\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 src\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 index.ts\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 tsconfig.build.json\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 tsconfig.json\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 foo\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 lib\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 index.d.ts\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 index.js\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 package.json\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 src\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 index.ts\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 tsconfig.build.json\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 tsconfig.json\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 tsconfig.build.json\n\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 tsconfig.json\nRun Code Online (Sandbox Code Playgroud)\n我需要能够完全重新加载子组件。实现这一点的最佳方法似乎是使用*ngIf带有布尔值的 simple ;设置false删除组件,然后设置true重新初始化,即:
<app-child *ngIf="enabled"></app-child>
Run Code Online (Sandbox Code Playgroud)
但是,似乎仅仅这样做还不足以快速删除/重新初始化组件:
reloadTree(){
this.enabled = false;
this.enabled = true; // doesn't work- child ngOnInit isn't called
}
Run Code Online (Sandbox Code Playgroud)
相反,我必须使用 asetTimeout才能工作:
reloadTree(){
this.enabled = false;
const self = this;
setTimeout(function(){
self.enabled = true;
}, 1);
}
Run Code Online (Sandbox Code Playgroud)
我认为这与 Angular 渲染模板的方式有关?这不是特别优雅 - 任何人都可以提出更好的方法来实现我在这里要做的事情吗?谢谢
我是编程新手。我正在做我的作业并且代码工作,所以我不会发布我的整个代码。我只是想知道是否可以添加“&&”和“||” 在相同条件下 - 我的条件是 a 必须等于 16,b 必须等于 5-9 中的任何数字。有什么建议?例如
if ( a == 16)
{
if (b == 5 || b == 6 || b == 7 || b == 8 || b == 9 )
{
printf("you pass\n");
}
}
Run Code Online (Sandbox Code Playgroud)
非常感谢 :)
我需要让C++对象在向量中拥有POSIX文件描述符.我有一个文件路径的向量,我用它来创建我的对象.这是我的代码:
main.cpp中
std::vector<MightyObject> mightyObjects;
std::vector<const char*> paths = {"awesomePath1", "awesomePath2"};
for (std::vector<const char*>::iterator it = paths.begin(); it != paths.end(); ++it)
{
mightyObjects.emplace_back(MightyObject(*it));
}
Run Code Online (Sandbox Code Playgroud)
MightyObject.cpp
MightyObject::MightyObject(const char* path)
{
this->fd = open(path, O_RDWR | O_NONBLOCK);
}
MightyObject::~MightyObject()
{
close(this.fd);
}
MightyObject::MightyObject(const MightyObject& obj)
{
this->fd = dup(obj.fd);
}
MightyObject& MightyObject::operator=(const MightyObject& other)
{
this->fd = dup(other.fd);
return *this;
}
Run Code Online (Sandbox Code Playgroud)
在mightyObjects中,我的对象包含错误的文件描述符......
我究竟做错了什么 ?
我无法实现芯片选择并向用户表明该芯片已被选择。
我有以下 html 模板代码:
<mat-chip-list [multiple]="true" [selectable]="true">
<mat-chip selected (selectionChange)="onSelectedChip($event)" [selectable]="true" *ngFor="let size of sizes | sizeEnumToSize">{{ size }}</mat-chip>
</mat-chip-list>
Run Code Online (Sandbox Code Playgroud)
最初我只是想让所有芯片都处于选定状态。我希望芯片能够直观地改变其状态,以向用户显示它已被选择。我也尝试过做 [selected]="true" 但这会产生与预期相同的正常列表。
我在这里缺少什么?
我有一段将随机字符串放入字符指针数组的代码:
char * str[100] = {0};
const int elems = sizeof(str)/sizeof(str[0]),size=5;
srand(time(0));
for(int i=0;i<elems;i++){
char rString[size] = {0};
for(int j = 0;j<size;j++){
rString[j] = 97+rand()%26;
}
rString[size] = '\0';
str[i] = new char[size];
strcpy(str[i],rString);
}
for(int i=0;i<elems;i++){
cout<<str[i]<<endl;
}
Run Code Online (Sandbox Code Playgroud)
但str[0]被污染或空虚。
在 Android Studio 中创建一个简单的项目时,出现此错误。
供您参考的日志文件:
2018-08-13 10:56:47,583 [e-1024-b02] INFO - e.project.sync.GradleSyncState - Started sync with Gradle for project 'My Application'.
2018-08-13 10:56:47,591 [e-1024-b02] INFO - idea.project.IndexingSuspender - Consuming IndexingSuspender activation event: SYNC_STARTED
2018-08-13 10:56:47,591 [e-1024-b02] INFO - idea.project.IndexingSuspender - Starting batch update for project: Project 'C:\Users\surya.s02\AndroidStudioProjects\MyApplication' My Application
2018-08-13 10:56:47,624 [thread 380] INFO - s.plugins.gradle.GradleManager - Instructing gradle to use java from C:/Program Files/Android/Android Studio/jre
2018-08-13 10:56:47,631 [thread 380] INFO - s.plugins.gradle.GradleManager - Instructing gradle to use java from C:/Program …Run Code Online (Sandbox Code Playgroud)