我尝试安装 npm,但得到以下内容error。我已经删除了 npm 并重新安装了它,但我再次收到以下错误:
npm ERR! Linux 4.15.0-30-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "start"
npm ERR! node v8.10.0
npm ERR! npm v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! vx-leave-system@0.0.1 start: `node ./tools/server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the vx-leave-system@0.0.1 start script 'node ./tools/server.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem …Run Code Online (Sandbox Code Playgroud) 如何2018-07-17从以下代码中分割数据:
getCompanyHolydayLeave() {
this.props.actions.getCompanyLeaveDetails().then(() => {
if (!this.props.common.getCompanyLeaveDetailsPending) {
const poyaArray= this.props.common.companyLeave
var result = poyaArray.map((poyaArray) => poyaArray.date )
var xData= result.toString().split("T")
this.setState({ companyLeave:xData });
}
});
}
Run Code Online (Sandbox Code Playgroud)
我的输出xdata是这样的.
0: "2018-04-29"
1: "18:30:00.000Z,2018-05-06"
?
2: "18:30:00.000Z,2018-05-28"
?
3: "18:30:00.000Z,2018-06-26"
Run Code Online (Sandbox Code Playgroud)
我需要这样的:
0: "2018-04-29"
1: "2018-05-06"
Run Code Online (Sandbox Code Playgroud)
我怎么能这样做?