adaptlearning / adapt_authoring

A server-based user interface for authoring eLearning courses using the Adapt framework.
https://www.adaptlearning.org/
GNU General Public License v3.0
513 stars 276 forks source link

Upgrade script error: Cannot find module '../../document' #2466

Open tomgreenfield opened 4 years ago

tomgreenfield commented 4 years ago

Expected Behaviour

A successful upgrade.

Actual Behaviour

Upgrade script errors when trying to check for migrations with

Error: Cannot find module '../../document'
Full log ```console D:\adapt_authoring switched to revision v0.10.1 Node dependencies installed successfully. Web application built successfully. Server has been updated successfully! Adapt authoring tool upgraded to v0.10.1 internal/modules/cjs/loader.js:583 throw err; ^ Error: Cannot find module '../../document' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15) at Function.Module._load (internal/modules/cjs/loader.js:507:25) at Module.require (internal/modules/cjs/loader.js:637:17) at require (internal/modules/cjs/helpers.js:20:18) at compile (D:\adapt_authoring\node_modules\migrate-mongoose\node_modules\mongoose\lib\services\document\compile.js:18:26) at Model.Document.$__setSchema (D:\adapt_authoring\node_modules\migrate-mongoose\node_modules\mongoose\lib\document.js:1918:3) at Function.compile (D:\adapt_authoring\node_modules\migrate-mongoose\node_modules\mongoose\lib\model.js:3955:19) at Mongoose.model (D:\adapt_authoring\node_modules\migrate-mongoose\node_modules\mongoose\lib\index.js:437:22) at NativeConnection.Connection.model (D:\adapt_authoring\node_modules\migrate-mongoose\node_modules\mongoose\lib\connection.js:1054:23) at exports.default (D:\adapt_authoring\node_modules\migrate-mongoose\dist\db.js:41:23) at new Migrator (D:\adapt_authoring\node_modules\migrate-mongoose\dist\lib.js:102:39) at D:\adapt_authoring\lib\installHelpers.js:314:22 at xfs.stat (D:\adapt_authoring\node_modules\fs-extra\lib\mkdirs\mkdirs.js:56:16) at callback (D:\adapt_authoring\node_modules\graceful-fs\polyfills.js:295:20) at FSReqWrap.oncomplete (fs.js:155:5) ```

This is most likely occuring due to the fact that the Node dependencies are upgraded while still use. This can, in theory, be ignored because there aren't any migrations bundled with the 0.10.1 release. However, this highlights the need for an overhaul of the upgrade script.

Steps to Reproduce

  1. node upgrade to version 0.10.1

Versions

tomgreenfield commented 4 years ago

Just seen the following:

Error: Cannot find module '../cursor'

Also see #2478.