我在尝试为某人更改 gatsby 站点中 a 链接的颜色时遇到了一些麻烦。我的 layout.js 看起来像这样:
import React from "react";
import { Link } from "gatsby";
import Background from "../images/glitter.png";
const ListLink = props => (
<li style={{ display: `inline-block`, marginRight: `1rem` }}>
<Link to={props.to}>{props.children}</Link>
</li>
);
export default ({ children }) => (
<div style={{ margin: `0 auto`, padding: `1rem 1rem` }}>
<header
style={{
marginBottom: `1rem`,
padding: `1rem`,
backgroundImage: `url(${Background})`
}}
>
<Link to="/" style={{ color: `#733380`, textShadow: `none`, backgroundImage: `none` }}>
<h3 style={{ display: `inline` }}>Savannah Schmidt</h3> …Run Code Online (Sandbox Code Playgroud) 我有一个新的 app.js 的最基本的框架,在节点中设置了sequelize 和express。每当我运行该项目时,我都会得到:
{ Error: SQLITE_CANTOPEN: unable to open database file errno: 14, code: 'SQLITE_CANTOPEN' }
我已经四处寻找解决方案,但根据我发现的其他帖子,我没有使用其他技术,例如电子,这些技术似乎会引起问题。我也尝试了将我的database.sqlite3从根目录移动到它自己的文件夹中的建议,但这没有帮助。
我的 app.js 看起来仍然像一个样板。我真的没有做太多事情,只是尝试在创建模型并使用sequelize-cli 迁移后测试连接。
const express = require('express');
const bodyParser = require('body-parser');
const path = require('path');
//Database Connection
const db = require('./config/database');
const Sequelize = require("sequelize");
const sequelize = new Sequelize({
dialect: "sqlite",
storage: "path/to/database.sqlite"
});
//Test the DB Connection
sequelize.authenticate()
.then(() => console.log('Database Connected'))
.catch(err => console.log('Error: ', err))
//Server
const app = express()
app.get('/', (req, res) => res.send('HELLO WORLD'))
const …Run Code Online (Sandbox Code Playgroud)