小编Kyl*_*een的帖子

Makefile中的语法错误:文件结束意外(期待"fi")

这是我的目标:

copy_python:
    if test -d $(VIRTUAL_ENV)/lib; then \
        cp -a $(VIRTUAL_ENV)/lib/python2.7/site-packages/. ./package/tmp/; \
    fi
    if test -d $(VIRTUAL_ENV)/lib64; then \
        cp -a $(VIRTUAL_ENV)/lib64/python2.7/site-packages/. ./package/tmp/; \ 
    fi
Run Code Online (Sandbox Code Playgroud)

这是错误:

/bin/sh: 2: Syntax error: end of file unexpected (expecting "fi")
Makefile:28: recipe for target 'copy_python' failed
make: *** [copy_python] Error 2
Run Code Online (Sandbox Code Playgroud)

为什么会出现此错误?

bash makefile syntax-error

4
推荐指数
1
解决办法
3022
查看次数

节点/续集:加载所有模型

我在models文件夹(artisans,stores,items和itemStores)中有4个模型,但它只将items模型加载到db变量中.为什么会这样?

server.js

var express = require('express');
var app = express();
var bodyParser = require('body-parser');
var db = require('./models');
var artisans = require('./app/routes/artisans.js');
var stores = require('./app/routes/stores.js');
var items = require('./app/routes/items.js');
var itemStores = require('./app/routes/itemStores.js');

var PORT = process.env.PORT || 3000;

// Set up the express app to handle data parsing
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended : true }));
app.use(bodyParser.text());
app.use(bodyParser.json({ type : "application/vmd.api-json"}));

// Static directory
app.use(express.static("app/public"));

artisans(app, db);
stores(app, db);
items(app, db);
itemsStores(app, db);

console.log(Object.keys(db));

db.sequelize.sync().then(function () {
    app.listen(PORT, function () …
Run Code Online (Sandbox Code Playgroud)

node.js express sequelize.js

1
推荐指数
1
解决办法
957
查看次数

标签 统计

bash ×1

express ×1

makefile ×1

node.js ×1

sequelize.js ×1

syntax-error ×1