编译出错
xjl271314 opened this issue · comments
npm run compile
error:SyntaxError: src/common/config/adapter.js: Unexpected token, expected ; (1:8)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! nideshop@1.0.0 compile: babel --no-babelrc src/ --presets think-node --out-dir app/
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the nideshop@1.0.0 compile script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
const fileCache = require('think-cache-file');
const {Console, File, DateFile} = require('think-logger3');
const path = require('path');
const database = require('./database.js');
const isDev = think.env === 'development';
/**
- cache adapter config
- @type {Object}
*/
exports.cache = {
type: 'file',
common: {
timeout: 24 * 60 * 60 * 1000
},
file: {
handle: fileCache,
cachePath: path.join(think.ROOT_PATH, 'runtime/cache'), // absoulte path is necessarily required
pathDepth: 1,
gcInterval: 24 * 60 * 60 * 1000 // gc interval
}
};
/**
- model adapter config
- @type {Object}
*/
exports.model = {
type: 'mysql',
common: {
logConnect: isDev,
logSql: isDev,
logger: msg => think.logger.info(msg)
},
mysql: {
handle: mysql,
database: 'nideshop',
prefix: 'nideshop_',
encoding: 'utf8mb4',
host: '127.0.0.1',
port: '3306',
user: 'root',
password: '我的密码',
dateStrings: true
}
};
我检查了adapter.js语法应该没错的 能帮助一起找一下原因吗?