プログラマ初心者です。
"npm start"をした際に以下のエラーが出るのですが、なにがだめなのか見当もつきません。だいたいこの辺が良くないという大まかなご助言だけでもいいので、どうかご教授お願いいたします。
$ npm start
プロジェクト名-keystone@0.0.0 start /vagrant/プロジェクト名
node keystone.js
/vagrant/プロジェクト名/node_modules/dotenv/lib/main.js:67
SyntaxError: Unexpected token ILLEGAL
at Object.exports.runInThisContext (vm.js:76:16)
at Module._compile (module.js:513:28)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/vagrant/alq/keystone.js:3:1)
at Module._compile (module.js:541:32)
「補足」
npm start
すると以下のエラーが上記にのさらに続きます。
npm ERR! Linux 2.6.32-573.el6.x86_64
npm ERR! argv "/home/vagrant/.nvm/versions/node/v6.3.1/bin/node" "/home/vagrant/.nvm/versions/node/v6.3.1/bin/npm" "start"
npm ERR! node v6.3.1
npm ERR! npm v3.10.0
npm ERR! code ELIFECYCLE
npm ERR! alq-keystone@0.0.0 start: `node keystone.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the alq-keystone@0.0.0 start script 'node keystone.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the alq-keystone package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node keystone.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs プロジェクト名-keystone
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls プロジェクト名-keystone
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /vagrant/alq/npm-debug.log
またkeystone.js
は以下の通りになっております
// Simulate config options from your production environment by
// customising the .env file in your project's root folder.
require('dotenv').config();
// Require keystone
var keystone = require('keystone');
// Initialise Keystone with your project's configuration.
// See http://keystonejs.com/guide/config for available options
// and documentation.
keystone.init({
'name': 'プロジェクト名-keystone',
'brand': 'プロジェクト名-keystone',
'sass': 'public',
'static': 'public',
'favicon': 'public/favicon.ico',
'views': 'templates/views',
'view engine': 'jade',
'emails': 'templates/emails',
'auto update': true,
'session': true,
'auth': true,
'user model': 'User',
'cloudinary config': process.env.CLOUDINARY_URL || ''
});
// Load your project's Models
keystone.import('models');
// Setup common locals for your templates. The following are required for the
// bundled templates and layouts. Any runtime locals (that should be set uniquely
// for each request) should be added to ./routes/middleware.js
keystone.set('locals', {
_: require('lodash'),
env: keystone.get('env'),
utils: keystone.utils,
editable: keystone.content.editable,
});
// Load your project's Routes
keystone.set('routes', require('./routes'));
// Setup common locals for your emails. The following are required by Keystone's
// default email templates, you may remove them if you're using your own.
keystone.set('email locals', {
logo_src: '/images/logo-email.gif',
logo_width: 194,
logo_height: 76,
theme: {
email_bg: '#f9f9f9',
link_color: '#2697de',
buttons: {
color: '#fff',
background_color: '#2697de',
border_color: '#1a7cb7',
},
},
});
// Load your project's email test routes
keystone.set('email tests', require('./routes/emails'));
// Configure the navigation bar in Keystone's Admin UI
keystone.set('nav', {
posts: ['posts', 'post-categories'],
galleries: 'galleries',
enquiries: 'enquiries',
users: 'users',
});
// Start Keystone to connect to your database and initialise the web server
[補足]
main.js
の67行目以降
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@5M-^O^@?H^O,?HM-^IE^HH?^@^@^@^@^@^