我在尝试解析<?php
$servername = "localhost";
$username = "username";
$password = "password";
$conn = mysqli_connect($servername, $username, $password);
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
$sql = "CREATE DATABASE LeagueData";
if (mysqli_query($conn, $sql)) {
echo "Database created successfully";
} else {
echo "Error creating database: " . mysqli_error($conn);
}
mysqli_close($conn);
?>
文件中的依赖项时遇到了问题:
form.ts
当我运行 import moment = require('moment');
class LocationViewModel {
public Id: number;
public Name: string;
constructor(id: number, name: string)
{
this.Id = id;
this.Name = name;
}
}
class SearchViewModel {
public fromLocations: Array<LocationViewModel> = [];
public loLcations: Array<LocationViewModel> = [];
public date: moment;
constructor() {
}
}
时,我收到此错误:
node_modules/typescript/bin/tsc
我的时刻依赖项存在于node_modules / @ types中。请参阅附图
这是我的tsconfig.json文件中的内容:
error TS2688: Cannot find type definition file for 'moment'.