adapt_authoring icon indicating copy to clipboard operation
adapt_authoring copied to clipboard

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

Open tomgreenfield opened this issue 5 years ago • 1 comments

Expected Behaviour

A successful upgrade.

Actual Behaviour

Upgrade script errors when trying to check for migrations with

Error: Cannot find module '../../document'
Full log
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

  • Authoring Tool Version: 0.10.0
  • Framework Version: 4.3
  • Node.js Version: 10.11
  • MongoDB Version: 3.2

tomgreenfield avatar Nov 04 '19 17:11 tomgreenfield

Just seen the following:

Error: Cannot find module '../cursor'

Also see #2478.

tomgreenfield avatar Feb 21 '20 12:02 tomgreenfield