balderdashy / sails

Realtime MVC Framework for Node.js
https://sailsjs.com
MIT License
22.84k stars 1.95k forks source link

Error: *- The adapter used by the `localDiskDb` datastore is not compatible with the current version of Sails/Waterline. The adapter should expose a valid `adapterApiVersion`. If you're using the beta release of Sails 1.0, try: npm install --save sails-disk@beta #4387

Open SpaceG opened 6 years ago

SpaceG commented 6 years ago

Hello!

I have a problem with adapters, which version i have to install right now.. i try both, but they dont work.. !

 info: Starting app...

--------------------------------------------------------------------------------
 Excuse my interruption, but it looks like this app
 does not have a "migrate" setting configured yet.
 (perhaps this is the first time you're lifting it with models?)

 Tired of seeing this prompt?  Edit config/models.js.

 In a production environment (NODE_ENV=production) Sails always uses
 migrate:'safe' to protect against inadvertent deletion of your data.
 But during development, you have a few different options:

 1. FOR DEV:      alter   wipe/drop and try to re-insert ALL my data (recommended)
 2. FOR TESTS:    drop    wipe/drop ALL my data every time I lift Sails
 3. FOR STAGING:  safe    don't auto-migrate my data. I will do it myself

 Read more: sailsjs.com/docs/concepts/models-and-orm/model-settings#?migrate
--------------------------------------------------------------------------------

What would you like Sails to do this time?
 ** NEVER CHOOSE "alter" or "drop" IF YOU ARE WORKING WITH PRODUCTION DATA **

prompt: ?:  2
--------------------------------------------------------------------------------
 OK!  Temporarily using migrate:'drop'...
 To skip this prompt in the future, edit config/models.js.
--------------------------------------------------------------------------------

/Users/jh/Desktop/gitlist Kopie 2/node_modules/sails-hook-orm/lib/check-adapter-compatibility.js:59
    throw flaverr('E_NOT_COMPATIBLE', new Error(
    ^

Error: 
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-

The adapter used by the `localDiskDb` datastore is not compatible with
the current version of Sails/Waterline.

The adapter should expose a valid `adapterApiVersion`.

If you're using the beta release of Sails 1.0, try:
npm install --save sails-disk@beta

-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-

    at checkAdapterCompatibility (/Users/jh/Desktop/gitlist Kopie 2/node_modules/sails-hook-orm/lib/check-adapter-compatibility.js:59:39)
    at _eachRelevantDatastoreName (/Users/jh/Desktop/gitlist Kopie 2/node_modules/sails-hook-orm/lib/initialize.js:424:9)
    at arrayEach (/Users/jh/Desktop/gitlist Kopie 2/node_modules/@sailshq/lodash/lib/index.js:1463:13)
    at Function.<anonymous> (/Users/jh/Desktop/gitlist Kopie 2/node_modules/@sailshq/lodash/lib/index.js:3525:13)
    at async.auto._checkAdapterCompatibility (/Users/jh/Desktop/gitlist Kopie 2/node_modules/sails-hook-orm/lib/initialize.js:416:9)
    at runTask (/Users/jh/Desktop/gitlist Kopie 2/node_modules/sails-hook-orm/node_modules/async/dist/async.js:1660:17)
    at /Users/jh/Desktop/gitlist Kopie 2/node_modules/sails-hook-orm/node_modules/async/dist/async.js:1602:17
    at processQueue (/Users/jh/Desktop/gitlist Kopie 2/node_modules/sails-hook-orm/node_modules/async/dist/async.js:1612:17)
    at taskComplete (/Users/jh/Desktop/gitlist Kopie 2/node_modules/sails-hook-orm/node_modules/async/dist/async.js:1630:13)
    at /Users/jh/Desktop/gitlist Kopie 2/node_modules/sails-hook-orm/node_modules/async/dist/async.js:1653:21
    at /Users/jh/Desktop/gitlist Kopie 2/node_modules/sails-hook-orm/node_modules/async/dist/async.js:339:31
    at /Users/jh/Desktop/gitlist Kopie 2/node_modules/sails-hook-orm/node_modules/async/dist/async.js:847:20
    at Timeout._onTimeout (/Users/jh/Desktop/gitlist Kopie 2/node_modules/sails-hook-orm/lib/initialize.js:406:18)
    at ontimeout (timers.js:482:11)
    at tryOnTimeout (timers.js:317:5)
    at Timer.listOnTimeout (timers.js:277:5)
codes-Mac-mini:gitlist Kopie 2 jh$ 

this is my datastore.js file :

/**

module.exports.datastores = {

  localDiskDb: {
    adapter: 'sails-disk'
  },

 mongodb: {
  adapter: 'sails-mongo',
  host: 'localhost',
  port: 27017,
  // user: 'username', //optional
  // password: 'password', //optional
  database: 'MongoDBDatabase1' //optional
}

};

/************************************************
 * add here your database with your Adapter: 
 * like : 'mongodb' SailsJsHacker.co  
 ************************************************/

 /*
module.exports.datastores = {
  default: {

      adapter: require('mongodb'),
      host: 'localhost',
      port: 27017,
      // user: 'username',
      // password: 'password',
      database: 'MongoDBDatabase1'

      }
  };

  */

and this my model.js file :

/**
 * Default model configuration
 * (sails.config.models)
 *
 * Unless you override them, the following properties will be included
 * in each of your models.
 *
 * For more info on Sails models, see:
 * http://sailsjs.org/#/documentation/concepts/ORM
 */

module.exports.models = {

  datastore: 'mongodb',

  /***************************************************************************
  *                                                                          *
  * Your app's default connection. i.e. the name of one of your app's        *
  * connections (see `config/connections.js`)                                *
  *                                                                          *
  ***************************************************************************/
  // connection: 'localDiskDb',

  /***************************************************************************
  *                                                                          *
  * How and whether Sails will attempt to automatically rebuild the          *
  * tables/collections/etc. in your schema.                                  *
  *                                                                          *
  * See http://sailsjs.org/#/documentation/concepts/ORM/model-settings.html  *
  *                                                                          *
  ***************************************************************************/
  //migrate: 'alter'

};

any idea ? :

my package.json file :


{
  "name": "",
  "private": true,
  "version": "0.0.0",
  "description": "a Sails application",
  "keywords": [],
  "dependencies": {
    "@sailshq/upgrade": "^1.0.9",
    "async": "2.1.4",
    "bcrypt": "~0.8.0",
    "ejs": "~0.8.4",
    "express": "^4.16.3",
    "grunt": "0.4.2",
    "grunt-sync": "0.0.8",
    "include-all": "~0.1.3",
    "lodash": "3.10.1",
    "mongodb": "^3.0.5",
    "passport": "~0.2.1",
    "passport-github": "^1.1.0",
    "passport-github2": "^0.1.11",
    "passport-local": "~1.0.0",
    "passport-twitter": "~1.0.2",
    "password-generator": "^0.2.3",
    "rc": "~0.5.0",
    "sails": "^1.0.1",
    "sails-disk": "^0.10.10",
    "sails-hook-grunt": "^1.0.8",
    "sails-hook-orm": "^2.0.0",
    "sails-hook-sockets": "^1.5.2",
    "sails-mongo": "^1.0.0",
    "sails-mysql": "^1.0.0",
    "shortid": "~2.1.3"
  },
  "devDependencies": {
    "grunt-contrib-clean": "^0.5.0",
    "grunt-contrib-coffee": "^0.10.1",
    "grunt-contrib-concat": "^0.3.0",
    "grunt-contrib-copy": "^0.5.0",
    "grunt-contrib-cssmin": "^0.9.0",
    "grunt-contrib-jst": "^0.6.0",
    "grunt-contrib-less": "^0.11.1",
    "grunt-contrib-uglify": "^0.4.1",
    "grunt-contrib-watch": "^0.5.3",
    "grunt-sails-linker": "^0.9.6"
  },
  "scripts": {
    "start": "node app.js",
    "debug": "node debug app.js"
  },
  "main": "app.js",
  "repository": {
    "type": "git",
    "url": "git://github.com/spaceg/oauthx"
  },
  "author": "lucas",
  "license": ""
}

Sails version1.0.1: Node version: NPM version: DB adapter name: N/A DB adapter version: N/A Operating system**:

sailsbot commented 6 years ago

Hi @SpaceG! It looks like you may have removed some required elements from the initial comment template, without which I can't verify that this post meets our contribution guidelines. To re-open this issue, please copy the template from here, paste it at the beginning of your initial comment, and follow the instructions in the text. Then post a new comment (e.g. "ok, fixed!") so that I know to go back and check.

Sorry to be a hassle, but following these instructions ensures that we can help you in the best way possible and keep the Sails project running smoothly.

*If you feel this message is in error, or you want to debate the merits of my existence (sniffle), please contact inquiries@sailsjs.com

mikermcneil commented 6 years ago

@SpaceG try changing your sails-disk dep version (or better yet, just removing it)

image