seed houses
This commit is contained in:
@@ -1,40 +1,39 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var fs = require("fs"),
|
import fs from "fs";
|
||||||
models = [],
|
import Sequelize from 'sequelize';
|
||||||
model_path = __dirname + "/../models",
|
|
||||||
files = fs.readdirSync(model_path),
|
var sequelize = new Sequelize("postgres://spikeuser:123456@localhost:5432/spike_proto", {
|
||||||
Sequelize = require("sequelize"),
|
pool: {
|
||||||
sequelize = new Sequelize("postgres://spikeuser:123456@localhost:5432/spike_proto", {
|
max: 5,
|
||||||
pool: {
|
min: 0,
|
||||||
max: 5,
|
idle: 10000
|
||||||
min: 0,
|
}
|
||||||
idle: 10000
|
});
|
||||||
}
|
const model_dir = __dirname + '/../models'
|
||||||
});
|
|
||||||
|
|
||||||
class Database {
|
class Database {
|
||||||
|
|
||||||
static sync(){
|
static sync(){
|
||||||
|
|
||||||
// define each model
|
fs.readdirSync(model_dir).forEach(function(file) {
|
||||||
for (var filename of files){
|
model = require(model_dir + '/' + file);
|
||||||
var path = model_path + "/" + filename,
|
Database[model.name] = model;
|
||||||
stats = fs.statSync(path)
|
Database.models.push(model);
|
||||||
if (stats.isFile()){
|
});
|
||||||
models.push(require(path));
|
console.log("!!!! TEST !!!!")
|
||||||
}
|
console.log(Database.PowerDatum);
|
||||||
}
|
|
||||||
|
|
||||||
// add associations
|
// add associations
|
||||||
for (var model of models){
|
for (var model of Database.models){
|
||||||
model.associate();
|
model.associate();
|
||||||
}
|
}
|
||||||
|
|
||||||
return sequelize.sync({force: true});
|
return sequelize.sync({force: true});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Database.Sequelize = Sequelize;
|
|
||||||
Database.sequelize = sequelize;
|
Database.sequelize = sequelize;
|
||||||
|
Database.Sequelize = Sequelize;
|
||||||
|
Database.models = [];
|
||||||
|
|
||||||
export Database;
|
export default Database;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
3
data/example/houses.csv
Normal file
3
data/example/houses.csv
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
1,Johnson
|
||||||
|
2,Beverley
|
||||||
|
3,Thompson
|
||||||
|
22
gulpfile.babel.js
Normal file
22
gulpfile.babel.js
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
import gulp from 'gulp';
|
||||||
|
import yargs from 'yargs';
|
||||||
|
import DB from './config/database';
|
||||||
|
import {PowerDataSeed, HouseSeed} from './lib/tasks/seed_data'
|
||||||
|
|
||||||
|
gulp.task('generate_power_csv', function(done){
|
||||||
|
DB.sync().then(()=>{
|
||||||
|
PowerDataSeed.generateCsv(yargs.argv, done);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('save_power_csv', function(done){
|
||||||
|
DB.sync().then(()=>{
|
||||||
|
PowerDataSeed.saveCsv(yargs.argv, done);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('save_house_csv', function(done){
|
||||||
|
DB.sync().then(()=>{
|
||||||
|
HouseSeed.saveCsv(yargs.argv, done);
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
var gulp = require("gulp"),
|
|
||||||
seedDate = require("./lib/tasks/seed_data");
|
|
||||||
|
|
||||||
gulp.task('seedData', seedData);
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
export class Model {
|
|
||||||
|
|
||||||
static associate(){}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -4,24 +4,23 @@
|
|||||||
* The first method defines the way we resolve an ID to its object.
|
* The first method defines the way we resolve an ID to its object.
|
||||||
* The second defines the way we resolve an object to its GraphQL type.
|
* The second defines the way we resolve an object to its GraphQL type.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import {
|
||||||
|
nodeDefinitions,
|
||||||
|
} from 'graphql-relay';
|
||||||
|
|
||||||
var {nodeInterface, nodeField} = nodeDefinitions(
|
var {nodeInterface, nodeField} = nodeDefinitions(
|
||||||
(globalId) => {
|
(globalId) => {
|
||||||
var {type, id} = fromGlobalId(globalId);
|
var {type, id} = fromGlobalId(globalId);
|
||||||
if (type === 'PowerDatum') {
|
return null;
|
||||||
return getUser(id);
|
|
||||||
} else if (type === 'Widget') {
|
|
||||||
return getWidget(id);
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
(obj) => {
|
(obj) => {
|
||||||
if (obj instanceof User) {
|
if (obj instanceof Array) {
|
||||||
return userType;
|
return Array;
|
||||||
} else if (obj instanceof Widget) {
|
|
||||||
return widgetType;
|
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
export {nodeInterface, nodeField};
|
||||||
|
|||||||
@@ -1,104 +1,71 @@
|
|||||||
module.exports = function(done) {
|
import extend from "extend";
|
||||||
|
import moment from "moment";
|
||||||
|
import csv from "fast-csv";
|
||||||
|
import fs from 'fs';
|
||||||
|
import MathUtils from "./../utils/math"
|
||||||
|
import DB from './../../config/database';
|
||||||
|
|
||||||
var csv = require("fast-csv"),
|
export class PowerDataSeed {
|
||||||
Database = require("./config/database"),
|
|
||||||
Country = require("./models/country"),
|
|
||||||
Datum = require("./models/datum"),
|
|
||||||
countries = [],
|
|
||||||
data = new Map();
|
|
||||||
|
|
||||||
function seedEmissions(fn){
|
static saveCsv(opts, done){
|
||||||
var i = -1;
|
opts = extend({
|
||||||
csv
|
path: __dirname + "/../../data/example/power_data.csv"
|
||||||
.fromPath(__dirname + "/data/CAIT/emissions.csv")
|
}, opts || {});
|
||||||
.on("data", (row)=>{
|
var stream = fs.createReadStream(opts.path),
|
||||||
i += 1;
|
csvStream = csv.fromStream(stream, {headers: ['house_id', 'time', 'power']}),
|
||||||
if (i == 0) return true;
|
rows = [];
|
||||||
var name = row[0],
|
|
||||||
year = parseInt(row[1]),
|
|
||||||
key = name + year,
|
|
||||||
energy = parseFloat(row[11]) || null,
|
|
||||||
industrial = parseFloat(row[12]) || null,
|
|
||||||
agriculture = parseFloat(row[13]) || null,
|
|
||||||
waste = parseFloat(row[14]) || null,
|
|
||||||
lucf = parseFloat(row[15]) || null,
|
|
||||||
total_emissions = Math.max((energy + industrial + agriculture + waste + lucf), parseFloat(row[3])) || null; // MtCO2eq
|
|
||||||
|
|
||||||
if (countries.indexOf(name) < 0) countries.push(name);
|
csvStream.on("data", function(data){
|
||||||
data.set(key, data.get(key) || {name: name, year: year});
|
rows.push(rows);
|
||||||
datum = data.get(key);
|
|
||||||
datum.energy_emissions = energy; // MtCO2eq
|
|
||||||
datum.industrial_emissions = industrial; // MtCO2eq
|
|
||||||
datum.agriculture_emissions = agriculture; // MtCO2eq
|
|
||||||
datum.waste_emissions = waste; // MtCO2eq
|
|
||||||
datum.lucf_emissions = lucf; // MtCO2eq
|
|
||||||
datum.total_emissions = total_emissions; // MtCO2eq
|
|
||||||
})
|
|
||||||
.on("end", fn);
|
|
||||||
}
|
|
||||||
function seedSocioEco(fn){
|
|
||||||
var i = -1;
|
|
||||||
csv
|
|
||||||
.fromPath(__dirname + "/data/CAIT/socioeconomic.csv")
|
|
||||||
.on("data", (row)=>{
|
|
||||||
i += 1;
|
|
||||||
if (i == 0) return true;
|
|
||||||
var name = row[0],
|
|
||||||
year = parseInt(row[1]),
|
|
||||||
key = (name + year),
|
|
||||||
population = parseInt(row[2]) || null,
|
|
||||||
gdp = parseFloat(row[4]) || null, // Million 2005 USD
|
|
||||||
energy = parseFloat(row[5]) || null; // ktoe
|
|
||||||
|
|
||||||
if (countries.indexOf(name) < 0) countries.push(name);
|
|
||||||
data.set(key, data.get(key) || {name: name, year: year});
|
|
||||||
datum = data.get(key);
|
|
||||||
datum.population = population;
|
|
||||||
datum.energy = energy;
|
|
||||||
datum.gdp = gdp;
|
|
||||||
})
|
|
||||||
.on("end", fn);
|
|
||||||
}
|
|
||||||
|
|
||||||
Database.sync().then(()=>{
|
|
||||||
seedEmissions(()=>{
|
|
||||||
seedSocioEco(()=>{
|
|
||||||
|
|
||||||
Country.sql.bulkCreate(countries.map((name)=>{ return {name: name}; }), {validate: true}).catch((errors)=>{
|
|
||||||
console.error(`=== Error ===\n${JSON.stringify(errors)}\n`);
|
|
||||||
}).then(()=>{
|
|
||||||
return Country.sql.findAll();
|
|
||||||
}).then((_countries)=>{
|
|
||||||
var country_name_to_id = new Map();
|
|
||||||
for (var country of _countries){
|
|
||||||
country_name_to_id.set(country.name, country.id);
|
|
||||||
}
|
|
||||||
for (var datum of data.values()){
|
|
||||||
datum.country_id = country_name_to_id.get(datum.name);
|
|
||||||
delete datum["name"];
|
|
||||||
}
|
|
||||||
|
|
||||||
var bulk_data = Array.from(data.values());
|
|
||||||
Datum.sql.bulkCreate(bulk_data, {validate: true}).catch((errors)=>{
|
|
||||||
console.error(`=== Error ===\n${JSON.stringify(errors)}\n`);
|
|
||||||
}).error((err)=>{
|
|
||||||
console.error(`=== Error ===\n${err}`);
|
|
||||||
}).then(()=>{
|
|
||||||
return Datum.sql.count();
|
|
||||||
}).then((count)=>{
|
|
||||||
console.log(`Count: ${count} ${bulk_data.length}`)
|
|
||||||
if (count === bulk_data.length){
|
|
||||||
done();
|
|
||||||
} else {
|
|
||||||
console.log("Error!");
|
|
||||||
done();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
csvStream.on("end", function(){
|
||||||
|
DB.PowerDatum.bulkCreate(rows, {validate: true}).then(done);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
static generateCsv(opts, done){
|
||||||
|
opts = extend({
|
||||||
|
start_date: moment.subtract(1, "months").unix(),
|
||||||
|
end_date: moment().unix(),
|
||||||
|
interval: 15 * 60, // every 15 minutes (in s)
|
||||||
|
average: 1400, // Wh
|
||||||
|
path: __dirname + "/../../data/example/power_data.csv"
|
||||||
|
}, opts || {});
|
||||||
|
|
||||||
|
var row_date = opts.start_date,
|
||||||
|
csvStream = csv.format({headers: true}),
|
||||||
|
writableStream = fs.createWriteStream(opts.path);
|
||||||
|
|
||||||
|
csvStream.pipe(writableStream);
|
||||||
|
writableStream.on("finish", done);
|
||||||
|
|
||||||
|
while (row_date <= end_date){
|
||||||
|
csvStream.write(house_ids.map((house_id)=>{
|
||||||
|
return [house_id, row_date, MathUtils.normal(opts.average)]
|
||||||
|
}));
|
||||||
|
row_date += opts.interval;
|
||||||
|
}
|
||||||
|
csvStream.end();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class HouseSeed {
|
||||||
|
static saveCsv(opts, done){
|
||||||
|
opts = extend({
|
||||||
|
path: __dirname + "/../../data/example/houses.csv"
|
||||||
|
}, opts || {});
|
||||||
|
var stream = fs.createReadStream(opts.path),
|
||||||
|
csvStream = csv.fromStream(stream, {headers: ['id', 'name']}),
|
||||||
|
rows = [];
|
||||||
|
|
||||||
|
csvStream.on("data", function(data){
|
||||||
|
console.log(JSON.stringify(data))
|
||||||
|
rows.push(data);
|
||||||
|
});
|
||||||
|
csvStream.on("end", function(){
|
||||||
|
console.log(rows);
|
||||||
|
DB.House.bulkCreate(rows, {validate: true}).then(done);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
};
|
|
||||||
|
|||||||
10
lib/utils/math.js
Normal file
10
lib/utils/math.js
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
export default class {
|
||||||
|
|
||||||
|
static normal(average){
|
||||||
|
return average + n6() * average;
|
||||||
|
}
|
||||||
|
|
||||||
|
static n6(){
|
||||||
|
return ((Math.random() + Math.random() + Math.random() + Math.random() + Math.random() + Math.random()) - 3) / 3;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
var Database = require("./../config/database");
|
|
||||||
|
|
||||||
class Country {
|
|
||||||
|
|
||||||
static associate(){
|
|
||||||
var Datum = require("./datum");
|
|
||||||
this.sql.hasOne(Datum.sql, {as: "Data", foreignKey: "id", constraints: false});
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
Country.sql = Database.sequelize.define('Country', {
|
|
||||||
id: {
|
|
||||||
type: Database.Sequelize.INTEGER,
|
|
||||||
primaryKey: true,
|
|
||||||
autoIncrement: true // Automatically gets converted to SERIAL for postgres
|
|
||||||
},
|
|
||||||
name: {
|
|
||||||
type: Database.Sequelize.STRING,
|
|
||||||
unique: true,
|
|
||||||
allowNull: false
|
|
||||||
}
|
|
||||||
}, {tableName: "countries"});
|
|
||||||
|
|
||||||
Country.graphql = new GraphQLObjectType({
|
|
||||||
name: "Country",
|
|
||||||
description: "A world country",
|
|
||||||
fields: ()=>{
|
|
||||||
id: {
|
|
||||||
type: new GraphQLNonNull(GraphQLInteger)
|
|
||||||
},
|
|
||||||
name: {
|
|
||||||
type: new GraphQLNonNull(GraphQLString)
|
|
||||||
},
|
|
||||||
data: {
|
|
||||||
type: new GraphQLList(Datum.graphql),
|
|
||||||
args: {
|
|
||||||
year: {
|
|
||||||
type: GraphQLList(GraphQLInteger)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
resolve: (country, args)=>{
|
|
||||||
debugger
|
|
||||||
if (args.year){
|
|
||||||
country.getData({where: args});
|
|
||||||
} else {
|
|
||||||
country.getData();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
module.exports = Country;
|
|
||||||
@@ -1,78 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
var Database = require("./../config/database");
|
|
||||||
|
|
||||||
class Datum {
|
|
||||||
static associate(){
|
|
||||||
var Country = require("./country");
|
|
||||||
this.sql.belongsTo(Country.sql, {foreignKey: "country_id", targetKey: "id", constraints: false});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Datum.sql = Database.sequelize.define('Datum', {
|
|
||||||
id: {
|
|
||||||
type: Database.Sequelize.INTEGER,
|
|
||||||
primaryKey: true,
|
|
||||||
autoIncrement: true // Automatically gets converted to SERIAL for postgres
|
|
||||||
},
|
|
||||||
country_id: {
|
|
||||||
type: Database.Sequelize.INTEGER,
|
|
||||||
unique: "country_year",
|
|
||||||
references: {
|
|
||||||
model: "countries",
|
|
||||||
key: "id",
|
|
||||||
allowNull: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
year: {
|
|
||||||
type: Database.Sequelize.INTEGER,
|
|
||||||
unique: "country_year",
|
|
||||||
allowNull: false
|
|
||||||
},
|
|
||||||
population: Database.Sequelize.BIGINT,
|
|
||||||
gdp: Database.Sequelize.FLOAT,
|
|
||||||
total_emissions: Database.Sequelize.FLOAT,
|
|
||||||
energy_emissions: Database.Sequelize.FLOAT,
|
|
||||||
industrial_emissions: Database.Sequelize.FLOAT,
|
|
||||||
agriculture_emissions: Database.Sequelize.FLOAT,
|
|
||||||
waste_emissions: Database.Sequelize.FLOAT,
|
|
||||||
lucf_emissions: Database.Sequelize.FLOAT,
|
|
||||||
energy: Database.Sequelize.FLOAT
|
|
||||||
}, {tableName: "data"});
|
|
||||||
|
|
||||||
Datum.graphql = new GraphQLObjectType({
|
|
||||||
name: "Datum",
|
|
||||||
description: "A world country",
|
|
||||||
fields: ()=>{
|
|
||||||
year: {
|
|
||||||
type: new GraphQLNonNull(GraphQLString)
|
|
||||||
},
|
|
||||||
population: {
|
|
||||||
type: GraphQLInteger
|
|
||||||
},
|
|
||||||
gdp: {
|
|
||||||
type: GraphQLFloat
|
|
||||||
},
|
|
||||||
total_emissions: {
|
|
||||||
type: GraphQLFloat
|
|
||||||
},
|
|
||||||
energy_emissions: {
|
|
||||||
type: GraphQLFloat
|
|
||||||
},
|
|
||||||
industrial_emissions: {
|
|
||||||
type: GraphQLFloat
|
|
||||||
},
|
|
||||||
agriculture_emissions: {
|
|
||||||
type: GraphQLFloat
|
|
||||||
},
|
|
||||||
waste_emissions: {
|
|
||||||
type: GraphQLFloat
|
|
||||||
},
|
|
||||||
lucf_emissions: {
|
|
||||||
type: GraphQLFloat
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
module.exports = Datum;
|
|
||||||
@@ -10,28 +10,28 @@ import {
|
|||||||
nodeDefinitions,
|
nodeDefinitions,
|
||||||
} from 'graphql-relay';
|
} from 'graphql-relay';
|
||||||
|
|
||||||
import Database from "./../config/database";
|
import DB from "./../config/database";
|
||||||
import PowerData from "./power_datum"
|
import {nodeInterface} from './../lib/node.relay';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Define your own types here
|
* Define your own types here
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var House = Database.sequelize.define('House', {
|
var House = DB.sequelize.define('House', {
|
||||||
id: {
|
id: {
|
||||||
type: Database.Sequelize.INTEGER,
|
type: DB.Sequelize.INTEGER,
|
||||||
primaryKey: true,
|
primaryKey: true,
|
||||||
autoIncrement: true // Automatically gets converted to SERIAL for postgres
|
autoIncrement: true // Automatically gets converted to SERIAL for postgres
|
||||||
},
|
},
|
||||||
name: Database.Sequelize.STRING
|
name: DB.Sequelize.STRING
|
||||||
}, {
|
}, {
|
||||||
tableName: "houses",
|
tableName: "houses",
|
||||||
instanceMethods: {
|
instanceMethods: {
|
||||||
|
|
||||||
},
|
},
|
||||||
classMethods: {
|
classMethods: {
|
||||||
associate: function(){
|
associate: ()=>{
|
||||||
House.hasMany(PowerDatum, {as: 'PowerData'})
|
House.hasMany(DB.PowerDatum, {as: 'PowerData'});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -45,5 +45,5 @@ House.graphql_type = new GraphQLObjectType({
|
|||||||
}),
|
}),
|
||||||
interfaces: [nodeInterface],
|
interfaces: [nodeInterface],
|
||||||
});
|
});
|
||||||
|
House.name = 'House';
|
||||||
export House;
|
module.exports = House;
|
||||||
|
|||||||
@@ -7,40 +7,38 @@ import {
|
|||||||
|
|
||||||
import {
|
import {
|
||||||
fromGlobalId,
|
fromGlobalId,
|
||||||
globalIdField,
|
globalIdField
|
||||||
nodeDefinitions,
|
|
||||||
} from 'graphql-relay';
|
} from 'graphql-relay';
|
||||||
|
|
||||||
import Database from "./../config/database";
|
import DB from "./../config/database";
|
||||||
import PowerData from "./house"
|
import {nodeInterface} from './../lib/node.relay';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Define your own types here
|
* Define your own types here
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var PowerDatum = Database.sequelize.define('Datum', {
|
var PowerDatum = DB.sequelize.define('PowerDatum', {
|
||||||
id: {
|
id: {
|
||||||
type: Database.Sequelize.INTEGER,
|
type: DB.Sequelize.INTEGER,
|
||||||
primaryKey: true,
|
primaryKey: true,
|
||||||
autoIncrement: true // Automatically gets converted to SERIAL for postgres
|
autoIncrement: true // Automatically gets converted to SERIAL for postgres
|
||||||
},
|
},
|
||||||
time: Database.Sequelize.FLOAT,
|
time: DB.Sequelize.FLOAT,
|
||||||
power: Database.Sequelize.FLOAT
|
power: DB.Sequelize.FLOAT
|
||||||
}, {
|
}, {
|
||||||
tableName: "power_data",
|
tableName: "power_data",
|
||||||
instanceMethods: {
|
instanceMethods: {
|
||||||
|
|
||||||
},
|
},
|
||||||
classMethods: {
|
classMethods: {
|
||||||
associate: function(){
|
associate: ()=>{
|
||||||
PowerDatum.belongsTo(House);
|
PowerDatum.belongsTo(DB.House);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
PowerDatum.graphql_type = new GraphQLObjectType({
|
PowerDatum.graphql_type = new GraphQLObjectType({
|
||||||
name: 'Power Datum',
|
name: 'PowerDatum',
|
||||||
description: 'A person who uses our app',
|
description: 'A person who uses our app',
|
||||||
fields: () => ({
|
fields: () => ({
|
||||||
id: globalIdField('PowerDatum'),
|
id: globalIdField('PowerDatum'),
|
||||||
@@ -49,5 +47,6 @@ PowerDatum.graphql_type = new GraphQLObjectType({
|
|||||||
}),
|
}),
|
||||||
interfaces: [nodeInterface],
|
interfaces: [nodeInterface],
|
||||||
});
|
});
|
||||||
|
PowerDatum.name = 'PowerDatum';
|
||||||
|
|
||||||
export PowerDatum;
|
module.exports = PowerDatum;
|
||||||
|
|||||||
@@ -1,47 +0,0 @@
|
|||||||
0 info it worked if it ends with ok
|
|
||||||
1 verbose cli [ '/home/eric/.nvm/v5.4.1/bin/node',
|
|
||||||
1 verbose cli '/home/eric/.nvm/v5.4.1/bin/npm',
|
|
||||||
1 verbose cli 'start' ]
|
|
||||||
2 info using npm@3.5.3
|
|
||||||
3 info using node@v5.4.1
|
|
||||||
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
|
|
||||||
5 info lifecycle spike_proto@0.0.0~prestart: spike_proto@0.0.0
|
|
||||||
6 silly lifecycle spike_proto@0.0.0~prestart: no script for prestart, continuing
|
|
||||||
7 info lifecycle spike_proto@0.0.0~start: spike_proto@0.0.0
|
|
||||||
8 verbose lifecycle spike_proto@0.0.0~start: unsafe-perm in lifecycle true
|
|
||||||
9 verbose lifecycle spike_proto@0.0.0~start: PATH: /home/eric/.nvm/v5.4.1/lib/node_modules/npm/bin/node-gyp-bin:/home/eric/Code/spike_proto/node_modules/.bin:/home/eric/.nvm/v5.4.1/bin:/home/eric/.rvm/gems/ruby-1.9.3-p484@oroeco_dev/bin:/home/eric/.rvm/gems/ruby-1.9.3-p484@global/bin:/home/eric/.rvm/rubies/ruby-1.9.3-p484/bin:/home/eric/.rvm/bin:/home/eric/bin:/usr/local/heroku/bin:/home/eric/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/opt/lampp/bin
|
|
||||||
10 verbose lifecycle spike_proto@0.0.0~start: CWD: /home/eric/Code/spike_proto
|
|
||||||
11 silly lifecycle spike_proto@0.0.0~start: Args: [ '-c', 'babel-node ./app.js' ]
|
|
||||||
12 silly lifecycle spike_proto@0.0.0~start: Returned: code: 1 signal: null
|
|
||||||
13 info lifecycle spike_proto@0.0.0~start: Failed to exec start script
|
|
||||||
14 verbose stack Error: spike_proto@0.0.0 start: `babel-node ./app.js`
|
|
||||||
14 verbose stack Exit status 1
|
|
||||||
14 verbose stack at EventEmitter.<anonymous> (/home/eric/.nvm/v5.4.1/lib/node_modules/npm/lib/utils/lifecycle.js:232:16)
|
|
||||||
14 verbose stack at emitTwo (events.js:87:13)
|
|
||||||
14 verbose stack at EventEmitter.emit (events.js:172:7)
|
|
||||||
14 verbose stack at ChildProcess.<anonymous> (/home/eric/.nvm/v5.4.1/lib/node_modules/npm/lib/utils/spawn.js:24:14)
|
|
||||||
14 verbose stack at emitTwo (events.js:87:13)
|
|
||||||
14 verbose stack at ChildProcess.emit (events.js:172:7)
|
|
||||||
14 verbose stack at maybeClose (internal/child_process.js:821:16)
|
|
||||||
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
|
|
||||||
15 verbose pkgid spike_proto@0.0.0
|
|
||||||
16 verbose cwd /home/eric/Code/spike_proto
|
|
||||||
17 error Linux 3.19.0-43-generic
|
|
||||||
18 error argv "/home/eric/.nvm/v5.4.1/bin/node" "/home/eric/.nvm/v5.4.1/bin/npm" "start"
|
|
||||||
19 error node v5.4.1
|
|
||||||
20 error npm v3.5.3
|
|
||||||
21 error code ELIFECYCLE
|
|
||||||
22 error spike_proto@0.0.0 start: `babel-node ./app.js`
|
|
||||||
22 error Exit status 1
|
|
||||||
23 error Failed at the spike_proto@0.0.0 start script 'babel-node ./app.js'.
|
|
||||||
23 error Make sure you have the latest version of node.js and npm installed.
|
|
||||||
23 error If you do, this is most likely a problem with the spike_proto package,
|
|
||||||
23 error not with npm itself.
|
|
||||||
23 error Tell the author that this fails on your system:
|
|
||||||
23 error babel-node ./app.js
|
|
||||||
23 error You can get information on how to open an issue for this project with:
|
|
||||||
23 error npm bugs spike_proto
|
|
||||||
23 error Or if that isn't available, you can get their info via:
|
|
||||||
23 error npm owner ls spike_proto
|
|
||||||
23 error There is likely additional logging output above.
|
|
||||||
24 verbose exit [ 1, true ]
|
|
||||||
@@ -50,7 +50,11 @@
|
|||||||
"css-loader": "^0.15.5",
|
"css-loader": "^0.15.5",
|
||||||
"style-loader": "^0.12.3",
|
"style-loader": "^0.12.3",
|
||||||
"connect-assets":"~4.7.0",
|
"connect-assets":"~4.7.0",
|
||||||
"node-sass": "3.4.2"
|
"node-sass": "3.4.2",
|
||||||
|
"moment": "2.11.1",
|
||||||
|
"yargs": "3.32.0",
|
||||||
|
"extend": "3.0.0"
|
||||||
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"gulp": "^3.9.0",
|
"gulp": "^3.9.0",
|
||||||
|
|||||||
Reference in New Issue
Block a user