Skip to content

Sails New Demo App Dead on Arrival Due to NeDB Errors #7362

@tdworz

Description

@tdworz

Basics
Operating System: MacOS 15.5
Node Version: 24.4.0
NPM Version: 11.4.2
Sails Version: 1.5.14

Issue
I decided to check out Sails.js for the first time today. Following the Getting Started page, this was my experience:

$ npm install sails -g
...
npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated rimraf@2.7.1: Rimraf versions prior to v4 are no longer supported
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm warn deprecated glob@7.1.2: Glob versions prior to v9 are no longer supported
...

$ sails new test-project
 Choose a template for your new Sails app:
 1. Web App  ·  Extensible project with auth, login, & password recovery
...
? 1
...

$ cd test-project 
$ sails lift

 info: Starting app...

 info: Initializing project hook... (`api/hooks/custom/`)
 info: Initializing `apianalytics` hook...  (requests to monitored routes will be logged!)
 info: ·• Auto-migrating...  (alter)
 info:    Hold tight, this could take a moment.
(node:24478) [DEP0044] DeprecationWarning: The `util.isArray` API is deprecated. Please use `Array.isArray()` instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
 info:  ✓ Auto-migration complete.

debug: Running v0 bootstrap script...  (looks like this is the first time the bootstrap has run on this computer)
error: Bootstrap encountered an error: (see below)
error: 
error: OperationalError [AdapterError]: Unexpected error from database adapter: util.isDate is not a function
    at module.exports.bootstrap (/Users/tom/Code/Playground/test-project/config/bootstrap.js:62:14) {
  cause: Error [AdapterError]: Unexpected error from database adapter: util.isDate is not a function
      at module.exports.bootstrap (/Users/tom/Code/Playground/test-project/config/bootstrap.js:62:14) {
    adapterMethodName: 'createEach',
    modelIdentity: 'user',
    raw: TypeError: util.isDate is not a function
        at Object.deepCopy (/Users/tom/Code/Playground/test-project/node_modules/@sailshq/nedb/lib/model.js:116:14)
        at Datastore.prepareDocumentForInsertion (/Users/tom/Code/Playground/test-project/node_modules/@sailshq/nedb/lib/datastore.js:384:25)
        at /Users/tom/Code/Playground/test-project/node_modules/@sailshq/nedb/lib/datastore.js:382:59
        at Array.forEach (<anonymous>)
        at Datastore.prepareDocumentForInsertion (/Users/tom/Code/Playground/test-project/node_modules/@sailshq/nedb/lib/datastore.js:382:12)
        at Datastore._insert (/Users/tom/Code/Playground/test-project/node_modules/@sailshq/nedb/lib/datastore.js:348:24)
        at /Users/tom/Code/Playground/test-project/node_modules/@sailshq/nedb/lib/executor.js:40:13
        at Immediate.process (/Users/tom/Code/Playground/test-project/node_modules/@sailshq/nedb/node_modules/async/lib/async.js:731:21)
        at process.processImmediate (node:internal/timers:505:21)
  },
  isOperational: true,
  adapterMethodName: 'createEach',
  modelIdentity: 'user',
  raw: TypeError: util.isDate is not a function
      at Object.deepCopy (/Users/tom/Code/Playground/test-project/node_modules/@sailshq/nedb/lib/model.js:116:14)
      at Datastore.prepareDocumentForInsertion (/Users/tom/Code/Playground/test-project/node_modules/@sailshq/nedb/lib/datastore.js:384:25)
      at /Users/tom/Code/Playground/test-project/node_modules/@sailshq/nedb/lib/datastore.js:382:59
      at Array.forEach (<anonymous>)
      at Datastore.prepareDocumentForInsertion (/Users/tom/Code/Playground/test-project/node_modules/@sailshq/nedb/lib/datastore.js:382:12)
      at Datastore._insert (/Users/tom/Code/Playground/test-project/node_modules/@sailshq/nedb/lib/datastore.js:348:24)
      at /Users/tom/Code/Playground/test-project/node_modules/@sailshq/nedb/lib/executor.js:40:13
      at Immediate.process (/Users/tom/Code/Playground/test-project/node_modules/@sailshq/nedb/node_modules/async/lib/async.js:731:21)
      at process.processImmediate (node:internal/timers:505:21)
}

error: Could not load Sails app.
error: 
error: Tips:
error:  • First, take a look at the error message above.
error:  • Make sure you've installed dependencies with `npm install`.
error:  • Check that this app was built for a compatible version of Sails.
error:  • Have a question or need help?  (http://sailsjs.com/support)

Since this seems to be an NeDB error, I went to check in with NeDB. Looks like they stopped maintenance in 2021 (louischatriot/nedb@2436f61) and there has not been any new code added since 2016.

Perhaps it's time to rely on something else for the demo functionality.

The Empty app option (option 2 when running sails new) generated an app that ran fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions