我设置了一个create-react-app
,我试图在localhost上运行App.js,但是这样做后,yarn start
我收到以下错误消息:
22:23 $ yarn start
yarn run v1.3.2
$ react-scripts start
Could not find a required file.
Name: index.html
Searched in: /Users/-----/Desktop/---/----/hw/HW-REPO/hw-name/public
error Command failed with exit code 1.
Run Code Online (Sandbox Code Playgroud)
我已经用安装了yarn yarn install
,所以我不确定我的代码或文件结构是否有问题。
这是文件结构:
app-name
-client
--public
---index.html
---manifest.json
--src
---Components
----various folders
---App.js
---App.test.js
---index.js
-database
-model
-gitignore
-package-lock.json
-package.json
-server.js
-yarn.lock
Run Code Online (Sandbox Code Playgroud) 我知道它必须进入 <% %>,但我不确定它是否与典型的 forEach/for 循环有很大不同。EJS 站点上的文档非常有限,所以我来到这里。
<% include ../../partials/header %>
<body>
<main>
<h1>List of all quotes</h1>
<ul>
<li> <!-- for loop goes here, inside flounder -->
<%
all quote stuff goes here
author
content
wrap it in a link to its quote page
</li>
</ul>
</main>
</body>
</html>
Run Code Online (Sandbox Code Playgroud) 我让Metafizzy Isotope插件工作的运气为零。网络选项卡显示它没有通过。
我安装isotope-layout
在我需要它main-file.js
,但代码无法识别$(container).isotope
。
涂黑的部分是 的实际名称main-file.js
。
我也在使用 webpack 并且想知道它是否是问题的一部分,但我不能肯定地说。
索引.js:
// css imports here
import "jquery/dist/jquery.min.js";
import "bootstrap/dist/js/bootstrap.bundle.min.js";
import mainfile from "./SiteAssets/scripts/main-file.js";
Run Code Online (Sandbox Code Playgroud)
主文件.js:
import axios from "axios";
import "@babel/polyfill/dist/polyfill.js";
var isotope = require('isotope-layout'); // Seeing "'isotope' is declared but its value is never read
// var isotope = require('imports-loader?$=jquery!isotope-layout/dist/isotope.pkgd');
// import isotope from "isotope-layout";
let myClass,
names,
_token;
export default class {
constructor() {
myClass = this;
myClass.setTokenVar();
// a few …
Run Code Online (Sandbox Code Playgroud) (免责声明:我对JS很新)
嗨,大家好,
我正在开发一款随机挑选两张牌的游戏,根据结果你会得到一个弹出窗口.我一直在按照一套说明来完成它.
我有两个问题:
A.在控制台中我收到一条错误消息:
SyntaxError:missing; 在声明之前
它指的是{else 7号线上的},我不知道为什么我会得到它.假设我错过了一个;它在哪里?我想我会问另一组眼睛.
B.说明说我应该在控制台看到"用户翻转女王"和"用户翻王",但我不是.
如果问题1中的问题得到解决,我会看到它们吗?如果没有,那我该怎么办?
Tsardines
var cards = ["queen", "queen", "king", "king"];
var cardsInPlay = [];
var checkForMatch = function() {
if (cardsInPlay[0] === cardsInPlay[1])
alert('You found a match!');
} else {
alert('Sorry, try again.');
}
var flipCard = function(cardId) {
console.log("User flipped " + cards[cardId]);
cardsInPlay.push(cards[0]);
if (cardsInPlay.length === 2) {
checkForMatch();
}
flipcard(0);
flipcard(2);
Run Code Online (Sandbox Code Playgroud)我正在做作业,当我尝试运行时rails db:migrate
,出现错误unitialized constant Cheeses
。
我相信名字有误。
这是我的文件:
Straight_curdin / db / migrate / 20180423222002_cheeses.rb
class CreateCheeses < ActiveRecord::Migration[5.2]
def change
create_table :cheeses do |t|
t.string :name
t.string :milk_type
t.string :image_url
t.string :description
t.timestamps
end
end
end
Run Code Online (Sandbox Code Playgroud)
Straight_curdin / app / models / Cheese.rb
class Cheese < ApplicationRecord
end
Run Code Online (Sandbox Code Playgroud)