我正在尝试运行一个反应项目。在我运行命令后: npm start ,它给了我一个错误:
sh: SET: command not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! materials-trace@0.1.0 start: `SET PORT=3100 && node scripts/start.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the materials-trace@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/jzhu321/.npm/_logs/2019-04-22T09_29_51_770Z-debug.log …Run Code Online (Sandbox Code Playgroud) 我收到很多警告,例如:In file included from ...

您可以从不同的问题中看到它,但“包含 fi 文件”中存在相同的问题,我认为这意味着我重新导入 .h 文件?
我不知道这意味着什么。我的项目中有数百个这样的警告。
我有一个方法,其中包含一个在 Objective-C 中定义的块:
+(void)getNewList:(NewListRequestModel *)model returnInfo:(void(^)(NewListResponseModel* resModel))retModel;
Run Code Online (Sandbox Code Playgroud)
我像这样调用它:
[API getNewList:model returnInfo:^(NewListResponseModel *resModel) {
//code
}];
Run Code Online (Sandbox Code Playgroud)
在 Objective-C 中。
现在我想在 Swift 3.2 中调用它:
API.getNewList(model, returnInfo: {(resModel: NewListResponseModel) -> () in
//my code
})
Run Code Online (Sandbox Code Playgroud)
但我总是遇到错误:
Cannot convert value of type '(NewListResponseModel) -> Void' to expected argument type '((NewListResponseModel?) -> Void)!'
Run Code Online (Sandbox Code Playgroud)
有人可以帮助我以正确的方式调用它吗?谢谢。
ios ×2
closures ×1
node.js ×1
npm ×1
npm-install ×1
npm-scripts ×1
nsdate ×1
objective-c ×1
reactjs ×1
swift ×1
swift3 ×1
xcode ×1