如果我添加GCSAdapter,Parse Server实例将停止工作

时间:2017-01-29 16:45:16

标签: node.js parse-platform parse-server

我正在迁移到解析服务器。直到现在一切都运作良好。但现在我想添加谷歌云存储文件适配器,如果我将此行添加到我的代码,它将停止工作。你能告诉我原因吗。

var GCSAdapter = require('parse-server-gcs-adapter');

这是日志:

npm ERR! Linux 3.13.0-105-generic
npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
npm ERR! node v6.9.1
npm ERR! npm  v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! parse-server-example@1.4.0 start: `node index.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the parse-server-example@1.4.0 start script 'node index.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 parse-server-example package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node index.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs parse-server-example
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls parse-server-example
npm ERR! There is likely additional logging output above.
    2017-01-29T16:56:58.161879+00:00 app[web.1]: 
npm ERR! Please include the following file with any support request:
npm ERR!     /app/npm-debug.log

我的index.js文件:

// Example express application adding the parse-server module to expose Parse
// compatible API routes.

var express = require('express');
var ParseDashboard = require('parse-dashboard');
var ParseServer = require('parse-server').ParseServer;
var GCSAdapter = require('parse-server-gcs-adapter');
var path = require('path');

var databaseUri = process.env.DATABASE_URI || process.env.MONGODB_URI;

if (!databaseUri) {
  console.log('DATABASE_URI not specified, falling back to localhost.');
}

var api = new ParseServer({
  databaseURI: databaseUri || 'mongodb://localhost:27017/dev',
  cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
  appId: process.env.APP_ID || 'myAppId',
  masterKey: process.env.MASTER_KEY || '', //Add your master key here. Keep it secret!
  serverURL: process.env.SERVER_URL || 'http://localhost:1337/parse',  // Don't forget to change to https if needed
  // liveQuery: {
  //   classNames: ["Posts", "Comments"] // List of classes to support for query subscriptions
  // }
  // filesAdapter: new GCSAdapter(
  //   "oval-proxy-117311",
  //   "./SymboloKey",
  //   "Symbolo",
  //   {directAccess: true}
  // )
});
// Client-keys like the javascript key or the .NET key are not necessary with parse-server
// If you wish you require them, you can set them as options in the initialization above:
// javascriptKey, restAPIKey, dotNetKey, clientKey

const dashboard = new ParseDashboard( {
  'allowInsecureHTTP': true,
  'apps': [
    {
      'serverURL': process.env.SERVER_URL,
      'appName': 'Symbolo',
      'appId': process.env.APP_ID,
      'masterKey': process.env.MASTER_KEY
    }
  ],
  'users': [
    {
      'user': 'public',
      'pass': 'qwerty'
    }
  ]
}, true )

var app = express();

// Serve static assets from the /public folder
app.use('/public', express.static(path.join(__dirname, '/public')));

// Serve the Parse API on the /parse URL prefix
var mountPath = process.env.PARSE_MOUNT || '/parse';
app.use(mountPath, api);

// serve the Parse Dashboard
app.use('/dashboard', dashboard)

// Parse Server plays nicely with the rest of your web routes
app.get('/', function(req, res) {
  res.status(200).send('I dream of being a website.  Please star the parse-server repo on GitHub!');
});

// There will be a test page available on the /test path of your server url
// Remove this before launching your app
app.get('/test', function(req, res) {
  res.sendFile(path.join(__dirname, '/public/test.html'));
});

var port = process.env.PORT || 1337;
var httpServer = require('http').createServer(app);
httpServer.listen(port, function() {
    console.log('parse-server-example running on port ' + port + '.');
});

// This will enable the Live Query real-time server
// ParseServer.createLiveQueryServer(httpServer);

如果我运行npm install:

Klemens-MBP-2:Cloud klemen$ npm install
npm WARN deprecated mongodb@2.2.10: Please upgrade to 2.2.19 or higher

> bcrypt@1.0.2 install /Users/klemen/Dev/Newcomm/Cloud/node_modules/bcrypt
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v1.0.2/bcrypt_lib-v1.0.2-node-v51-darwin-x64.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for bcrypt@1.0.2 and node@7.4.0 (node-v51 ABI) (falling back to source compile with node-gyp) 

0 个答案:

没有答案