huridocs / uwazi

Uwazi is a web-based, open-source solution for building and sharing document collections
http://www.uwazi.io
MIT License
240 stars 80 forks source link

Issues with ./install.sh on Debian 10 with nvm #3998

Closed N07070 closed 2 years ago

N07070 commented 2 years ago

Hello

I've been trying to upgrade uwazi to it's last version, but I have been running into errors.

Versions of tools used ;

Situation

I've been following the instructions in the README. Every depedency is installed and works, as Uwazi was running without issues until I tried to upgrade it.

Step to reproduce

$ sudo su uwazi Now using node v14.6.0 (npm v6.14.6) $ git clone <uwazi> -b master OR $ wget <uwazi 1.42.0> && unzip 1.42.0 $ cd uwazi I'm refering to the git clone as of now, but I've tried it with the release zip too, the output is the same. $ yarn install

$ yarn install
yarn install v1.22.17
[1/5] Validating package.json...
[2/5] Resolving packages...
warning Resolution field "trim@0.0.3" is incompatible with requested version "trim@0.0.1"
warning Resolution field "normalize-url@6.0.1" is incompatible with requested version "normalize-url@^4.1.0"
warning Resolution field "normalize-url@6.0.1" is incompatible with requested version "normalize-url@^4.1.0"
[3/5] Fetching packages...
[4/5] Linking dependencies...
warning " > react-router@3.0.5" has incorrect peer dependency "react@^0.14.0 || ^15.0.0".
warning " > react-text-selection-handler@0.1.0" has incorrect peer dependency "react-dom@^17.0.1".
warning " > eslint-config-airbnb@18.2.0" has unmet peer dependency "eslint-plugin-react-hooks@^4 || ^3 || ^2.3.0 || ^1.7.0".
warning " > jest-puppeteer@4.4.0" has incorrect peer dependency "puppeteer@>= 1.5.0 < 3".
[5/5] Building fresh packages...
Done in 24.39s.

NB : I am not running $ yarn blank-state as this is an upgrade. $ ./install.sh

Building production
yarn run v1.22.17
$ ./webpack/build.sh
$ /srv/uwazi/node_modules/.bin/webpack --config ./webpack.production.config.js --progress --profile --colors
One CLI for webpack must be installed. These are recommended choices, delivered as separate packages:
 - webpack-cli (https://github.com/webpack/webpack-cli)
   The original webpack full-featured CLI.
We will use "yarn" to install the CLI via "yarn add -D".
Do you want to install 'webpack-cli' (yes/no): yes
Installing 'webpack-cli' (running 'yarn add -D webpack-cli')...
[1/5] Validating package.json...
[2/5] Resolving packages...
warning Resolution field "trim@0.0.3" is incompatible with requested version "trim@0.0.1"
warning Resolution field "normalize-url@6.0.1" is incompatible with requested version "normalize-url@^4.1.0"
warning Resolution field "normalize-url@6.0.1" is incompatible with requested version "normalize-url@^4.1.0"
[3/5] Fetching packages...
[4/5] Linking dependencies...
warning " > react-router@3.0.5" has incorrect peer dependency "react@^0.14.0 || ^15.0.0".
warning " > react-text-selection-handler@0.1.0" has incorrect peer dependency "react-dom@^17.0.1".
warning " > eslint-config-airbnb@18.2.0" has unmet peer dependency "eslint-plugin-react-hooks@^4 || ^3 || ^2.3.0 || ^1.7.0".
warning " > jest-puppeteer@4.4.0" has incorrect peer dependency "puppeteer@>= 1.5.0 < 3".
[5/5] Building fresh packages...
success Saved lockfile.
success Saved 15 new dependencies.
info Direct dependencies
└─ webpack-cli@4.9.1
info All dependencies
├─ @discoveryjs/json-ext@0.5.5
├─ @webpack-cli/configtest@1.1.0
├─ @webpack-cli/info@1.4.0
├─ @webpack-cli/serve@1.6.0
├─ clone-deep@4.0.1
├─ envinfo@7.8.1
├─ fastest-levenshtein@1.0.12
├─ human-signals@2.1.0
├─ is-core-module@2.8.0
├─ rechoir@0.7.1
├─ shallow-clone@3.0.1
├─ strip-final-newline@2.0.0
├─ webpack-cli@4.9.1
├─ webpack-merge@5.8.0
└─ wildcard@2.0.0
Error: Cannot find module 'webpack-cli'
Require stack:
- /srv/uwazi/node_modules/webpack/bin/webpack.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1065:15)
    at Function.Module._load (internal/modules/cjs/loader.js:911:27)
    at Module.require (internal/modules/cjs/loader.js:1125:19)
    at require (internal/modules/cjs/helpers.js:75:18)
    at /srv/uwazi/node_modules/webpack/bin/webpack.js:143:5
    at processTicksAndRejections (internal/process/task_queues.js:93:5) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/srv/uwazi/node_modules/webpack/bin/webpack.js' ]
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
installing into ./uwazi-production
Copying app files...
cp: impossible d'évaluer './prod/app': Aucun fichier ou dossier de ce type
Copying database files...
cp: impossible d'évaluer './prod/database': Aucun fichier ou dossier de ce type
Copying node modules...
cp: impossible d'évaluer './prod/node_modules': Aucun fichier ou dossier de ce type
Copying dist files...
cp: impossible d'évaluer './prod/dist': Aucun fichier ou dossier de ce type
cp: impossible d'évaluer './prod/public': Aucun fichier ou dossier de ce type
cp: impossible d'évaluer './prod/package.json': Aucun fichier ou dossier de ce type
cp: impossible d'évaluer './prod/run.js': Aucun fichier ou dossier de ce type
cp: impossible d'évaluer './prod/server.js': Aucun fichier ou dossier de ce type
cp: impossible d'évaluer './prod/message.js': Aucun fichier ou dossier de ce type
Updating database schema...
internal/modules/cjs/loader.js:1068
  throw err;
  ^

Error: Cannot find module '/srv/uwazi/uwazi-production/run.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1065:15)
    at Function.Module._load (internal/modules/cjs/loader.js:911:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
Reindexing ElasticSearch...
internal/modules/cjs/loader.js:1068
  throw err;
  ^

Error: Cannot find module '/srv/uwazi/uwazi-production/run.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1065:15)
    at Function.Module._load (internal/modules/cjs/loader.js:911:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

NB : This happens on the first run. If I run the ./install.sh command a second time, the output changes ;

$ ./install.sh 
Building production
yarn run v1.22.17
$ ./webpack/build.sh
$ /srv/uwazi/node_modules/.bin/webpack --config ./webpack.production.config.js --progress --profile --colors
[webpack-cli] Error: Unknown option '--profile'
[webpack-cli] Run 'webpack --help' to see available commands and options
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
installing into ./uwazi-production
Copying app files...
cp: impossible d'évaluer './prod/app': Aucun fichier ou dossier de ce type
Copying database files...
cp: impossible d'évaluer './prod/database': Aucun fichier ou dossier de ce type
Copying node modules...
cp: impossible d'évaluer './prod/node_modules': Aucun fichier ou dossier de ce type
Copying dist files...
cp: impossible d'évaluer './prod/dist': Aucun fichier ou dossier de ce type
cp: impossible d'évaluer './prod/public': Aucun fichier ou dossier de ce type
cp: impossible d'évaluer './prod/package.json': Aucun fichier ou dossier de ce type
cp: impossible d'évaluer './prod/run.js': Aucun fichier ou dossier de ce type
cp: impossible d'évaluer './prod/server.js': Aucun fichier ou dossier de ce type
cp: impossible d'évaluer './prod/message.js': Aucun fichier ou dossier de ce type
Updating database schema...
internal/modules/cjs/loader.js:1068
  throw err;
  ^

Error: Cannot find module '/srv/uwazi/uwazi-production/run.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1065:15)
    at Function.Module._load (internal/modules/cjs/loader.js:911:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
Reindexing ElasticSearch...
internal/modules/cjs/loader.js:1068
  throw err;
  ^

Error: Cannot find module '/srv/uwazi/uwazi-production/run.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1065:15)
    at Function.Module._load (internal/modules/cjs/loader.js:911:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

As the errors indicate, I need to remove the options --profile and --color.

If I do so, then the errors become ;

 ./install.sh 
Building production
yarn run v1.22.17
$ ./webpack/build.sh
$ /srv/uwazi/node_modules/.bin/webpack --config ./webpack.production.config.js --progress
[webpack-cli] Failed to load '/srv/uwazi/webpack.production.config.js' config
[webpack-cli] Error: Cannot find module 'optimize-css-assets-webpack-plugin'
Require stack:
- /srv/uwazi/webpack.production.config.js
- /srv/uwazi/node_modules/webpack-cli/lib/webpack-cli.js
- /srv/uwazi/node_modules/webpack-cli/lib/bootstrap.js
- /srv/uwazi/node_modules/webpack-cli/bin/cli.js
- /srv/uwazi/node_modules/webpack/bin/webpack.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1065:15)
    at Function.Module._load (internal/modules/cjs/loader.js:911:27)
    at Module.require (internal/modules/cjs/loader.js:1125:19)
    at require (internal/modules/cjs/helpers.js:75:18)
    at Object.<anonymous> (/srv/uwazi/webpack.production.config.js:3:33)
    at Module._compile (internal/modules/cjs/loader.js:1236:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1257:10)
    at Module.load (internal/modules/cjs/loader.js:1085:32)
    at Function.Module._load (internal/modules/cjs/loader.js:950:14)
    at Module.require (internal/modules/cjs/loader.js:1125:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/srv/uwazi/webpack.production.config.js',
    '/srv/uwazi/node_modules/webpack-cli/lib/webpack-cli.js',
    '/srv/uwazi/node_modules/webpack-cli/lib/bootstrap.js',
    '/srv/uwazi/node_modules/webpack-cli/bin/cli.js',
    '/srv/uwazi/node_modules/webpack/bin/webpack.js'
  ]
}
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
installing into ./uwazi-production
Copying app files...
cp: impossible d'évaluer './prod/app': Aucun fichier ou dossier de ce type
Copying database files...
cp: impossible d'évaluer './prod/database': Aucun fichier ou dossier de ce type
Copying node modules...
cp: impossible d'évaluer './prod/node_modules': Aucun fichier ou dossier de ce type
Copying dist files...
cp: impossible d'évaluer './prod/dist': Aucun fichier ou dossier de ce type
cp: impossible d'évaluer './prod/public': Aucun fichier ou dossier de ce type
cp: impossible d'évaluer './prod/package.json': Aucun fichier ou dossier de ce type
cp: impossible d'évaluer './prod/run.js': Aucun fichier ou dossier de ce type
cp: impossible d'évaluer './prod/server.js': Aucun fichier ou dossier de ce type
cp: impossible d'évaluer './prod/message.js': Aucun fichier ou dossier de ce type
Updating database schema...
internal/modules/cjs/loader.js:1068
  throw err;
  ^

Error: Cannot find module '/srv/uwazi/uwazi-production/run.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1065:15)
    at Function.Module._load (internal/modules/cjs/loader.js:911:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
Reindexing ElasticSearch...
internal/modules/cjs/loader.js:1068
  throw err;
  ^

Error: Cannot find module '/srv/uwazi/uwazi-production/run.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1065:15)
    at Function.Module._load (internal/modules/cjs/loader.js:911:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Which seem to indicate missing modules. To fix the missing modules, I've needed to install them via yarn add ;

$ yarn install && yarn add webpack-cli webpack optimize-css-assets-webpack-plugin terser-webpack-plugin assets-webpack-plugin clean-webpack-plugin mini-css-extract-plugin rtlcss-webpack-plugin copy-webpack-plugin webpack-bundle-analyzer && ./install.sh 2> >(tee -a errlog)

But installing them does not work either ;

$ /srv/uwazi/node_modules/.bin/webpack --config ./webpack.production.config.js --progress
[webpack-cli] Failed to load '/srv/uwazi/webpack.production.config.js' config
[webpack-cli] TypeError: webpack.optimize.OccurrenceOrderPlugin is not a constructor
    at Object.<anonymous> (/srv/uwazi/webpack.production.config.js:14:3)
    at Module._compile (internal/modules/cjs/loader.js:1236:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1257:10)
    at Module.load (internal/modules/cjs/loader.js:1085:32)
    at Function.Module._load (internal/modules/cjs/loader.js:950:14)
    at Module.require (internal/modules/cjs/loader.js:1125:19)
    at require (internal/modules/cjs/helpers.js:75:18)
    at WebpackCLI.tryRequireThenImport (/srv/uwazi/node_modules/webpack-cli/lib/webpack-cli.js:244:16)
    at loadConfigByPath (/srv/uwazi/node_modules/webpack-cli/lib/webpack-cli.js:1710:30)
    at /srv/uwazi/node_modules/webpack-cli/lib/webpack-cli.js:1765:11
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
installing into ./uwazi-production
Copying app files...
cp: impossible d'évaluer './prod/app': Aucun fichier ou dossier de ce type
Copying database files...
cp: impossible d'évaluer './prod/database': Aucun fichier ou dossier de ce type
Copying node modules...
cp: impossible d'évaluer './prod/node_modules': Aucun fichier ou dossier de ce type
Copying dist files...
cp: impossible d'évaluer './prod/dist': Aucun fichier ou dossier de ce type
cp: impossible d'évaluer './prod/public': Aucun fichier ou dossier de ce type
cp: impossible d'évaluer './prod/package.json': Aucun fichier ou dossier de ce type
cp: impossible d'évaluer './prod/run.js': Aucun fichier ou dossier de ce type
cp: impossible d'évaluer './prod/server.js': Aucun fichier ou dossier de ce type
cp: impossible d'évaluer './prod/message.js': Aucun fichier ou dossier de ce type
Updating database schema...
internal/modules/cjs/loader.js:1068
  throw err;
  ^

Error: Cannot find module '/srv/uwazi/uwazi-production/run.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1065:15)
    at Function.Module._load (internal/modules/cjs/loader.js:911:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
Reindexing ElasticSearch...
internal/modules/cjs/loader.js:1068
  throw err;
  ^

Error: Cannot find module '/srv/uwazi/uwazi-production/run.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1065:15)
    at Function.Module._load (internal/modules/cjs/loader.js:911:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

At this point I gave up and figured out I needed help. I've asked around, but to no avail.

Any help is appriciated, thanks :)

daneryl commented 2 years ago

@N07070 Is it possible that you are running the first yarn install with the environment variable NODE_ENV=production ? ( i have tested this locally and is the only way i found to replicate the same errors). echo NODE_ENV to check. This will explain the missing packages, all this packages are devDependencies defined in package.json and will not be installed on a production environment. if this is the issue you can repeat the process with NODE_ENV=development and it should work, let me know if this helps.

@txau @RafaPolit I think we should provide an already built uwazi on every release ? this will be really helpfull for anyone to upgrade easily.

N07070 commented 2 years ago

Hello @daneryl, thanks for the quick answer !

I had indeed the env variable set to production. I do not remember setting it, but it's possible that it was set by someone than me on the same server. Anyways... ( As a side note, it might be good to explicit that we need a NODE_ENV=development in the process of installing Uwazi in production ? )

I've then run ; $ yarn install

$ yarn install
yarn install v1.22.17
info No lockfile found.
[1/5] Validating package.json...
[2/5] Resolving packages...
warning joi@13.7.0: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
warning joi > hoek@5.0.4: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
warning joi > topo@3.0.3: This module has moved and is now available at @hapi/topo. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
warning joi > topo > hoek@6.1.3: This module has moved and is now available at @hapi/hoek. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
warning node-uuid@1.4.8: Use uuid module instead
warning react-datepicker > react-popper > popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
warning react-dropzone > attr-accept > core-js@2.6.12: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
warning recharts > core-js@2.5.7: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
warning socket.io > debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
warning socket.io > socket.io-parser > debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
warning socket.io > engine.io > debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
warning socket.io-redis > debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
warning superagent > formidable@1.2.6: Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau
warning @babel/cli > chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
warning @babel/cli > chokidar > fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
warning @babel/cli > chokidar > braces > snapdragon > source-map-resolve > urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
warning @babel/cli > chokidar > braces > snapdragon > source-map-resolve > resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
warning @types/jest-environment-puppeteer > @jest/environment > @jest/transform > jest-haste-map > fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
warning @types/jest-environment-puppeteer > @jest/environment > @jest/transform > jest-haste-map > sane@4.1.0: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
warning @types/mongodb > @types/bson@4.2.0: This is a stub types definition. bson provides its own type definitions, so you do not need this installed.
warning @types/mongoose > @types/mongodb@4.0.7: mongodb provides its own types. @types/mongodb is no longer needed.
warning @types/react-dnd@3.0.2: This is a stub types definition. react-dnd provides its own type definitions, so you don't need this installed.
warning @types/socket.io > @types/socket.io-parser@3.0.0: This is a stub types definition. socket.io-parser provides its own type definitions, so you do not need this installed.
warning fetch-mock > querystring@0.2.1: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
warning jest > jest-cli > jest-config > jest-environment-jsdom > jsdom > left-pad@1.3.0: use String.prototype.padStart()
warning jest > jest-cli > jest-config > jest-environment-jsdom > jsdom > request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
warning jest > jest-cli > jest-config > jest-environment-jsdom > jsdom > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
warning jest > jest-cli > jest-config > jest-environment-jsdom > jsdom > request > har-validator@5.1.5: this library is no longer supported
warning jest > jest-cli > jest-config > jest-environment-jsdom > jsdom > request > uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
warning jest-puppeteer > jest-environment-puppeteer > jest-dev-server > wait-on > core-js@2.6.12: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
warning jest-puppeteer > jest-environment-puppeteer > jest-dev-server > wait-on > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
warning jest-puppeteer > jest-environment-puppeteer > jest-dev-server > wait-on > @hapi/joi@15.1.1: Switch to 'npm install joi'
warning jest-puppeteer > jest-environment-puppeteer > jest-dev-server > wait-on > @hapi/joi > @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained
warning jest-puppeteer > jest-environment-puppeteer > jest-dev-server > wait-on > @hapi/joi > @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
warning jest-puppeteer > jest-environment-puppeteer > jest-dev-server > wait-on > @hapi/joi > @hapi/address@2.1.4: Moved to 'npm install @sideway/address'
warning jest-puppeteer > jest-environment-puppeteer > jest-dev-server > wait-on > @hapi/joi > @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained
warning jest-puppeteer > jest-environment-puppeteer > jest-dev-server > wait-on > @hapi/joi > @hapi/topo > @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
warning mongodb-memory-server@6.10.0: got accidentally released by an mis-configured semantic-release. Please use v6.9.6 or v7.0.0
warning mongodb-memory-server > mongodb-memory-server-core@6.10.0: got accidentally released by an mis-configured semantic-release. Please use v6.9.6 or v7.0.0
warning nightmare > electron > electron-download > nugget > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
warning nightmare > deep-defaults@1.0.5: not actively maintained; find alternatives
warning node-sass > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
warning node-sass > node-gyp > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
warning node-sass > node-gyp > tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
warning optimize-css-assets-webpack-plugin > cssnano > cssnano-preset-default > postcss-svgo > svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
warning rtlcss-webpack-plugin > babel-runtime > core-js@2.6.12: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
warning supertest > superagent > formidable@1.2.6: Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau
warning webpack > node-libs-browser > url > querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
warning webpack > watchpack > watchpack-chokidar2 > chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
warning webpack-dev-middleware > webpack-log > uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
warning webpack-hot-middleware > querystring@0.2.1: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
[3/5] Fetching packages...
**error jest-diff@27.3.1: The engine "node" is incompatible with this module. Expected version "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0". Got "14.6.0"**
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

I set the node version to the least required, i.e

$ nvm use 14.15
Now using node v14.15.5 (npm v6.14.11)

( :warning: This is an issue regarding the documentation of the installation ).

Which ;

[5/5] Building fresh packages...
success Saved lockfile.
Done in 112.97s.

Worked !

Now, onto the install ;

$ ./install.sh
Building production
yarn run v1.22.5
$ ./webpack/build.sh
$ /srv/uwazi-upgrade/node_modules/.bin/webpack --config ./webpack.production.config.js --progress --profile --colors
[webpack-cli] Error: Unknown option '--profile'
[webpack-cli] Run 'webpack --help' to see available commands and options
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
installing into ./uwazi-production
Copying app files...
cp: impossible d'évaluer './prod/app': Aucun fichier ou dossier de ce type
Copying database files...
cp: impossible d'évaluer './prod/database': Aucun fichier ou dossier de ce type
Copying node modules...
cp: impossible d'évaluer './prod/node_modules': Aucun fichier ou dossier de ce type
Copying dist files...
cp: impossible d'évaluer './prod/dist': Aucun fichier ou dossier de ce type
cp: impossible d'évaluer './prod/public': Aucun fichier ou dossier de ce type
cp: impossible d'évaluer './prod/package.json': Aucun fichier ou dossier de ce type
cp: impossible d'évaluer './prod/run.js': Aucun fichier ou dossier de ce type
cp: impossible d'évaluer './prod/server.js': Aucun fichier ou dossier de ce type
cp: impossible d'évaluer './prod/message.js': Aucun fichier ou dossier de ce type
Updating database schema...
internal/modules/cjs/loader.js:883
  throw err;
  ^

Error: Cannot find module '/srv/uwazi-upgrade/uwazi-production/run.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
Reindexing ElasticSearch...
internal/modules/cjs/loader.js:883
  throw err;
  ^

Error: Cannot find module '/srv/uwazi-upgrade/uwazi-production/run.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Still does not work...

@txau @RafaPolit I think we should provide an already built uwazi on every release ? this will be really helpfull for anyone to upgrade easily.

Yes, please, I cannot understate how much time this would have saved me the past two days, and the organization I work for in the past two years.

N07070 commented 2 years ago

🤨

daneryl commented 2 years ago

@N07070 Seems like you have a wrong version of webpack-cli, i suggest you checkout everything and reinstall node modules. ( please make sure you have a backup of the uploaded files and db )

git checkout .
rm -fr node_modules
yarn install
./install.sh

( As a side note, it might be good to explicit that we need a NODE_ENV=development in the process of installing Uwazi in production ? )

Yes i think we should mention this, its strange anyways, in theory there is no need to change that variable, maybe some of our scripts is doing the export to production, we should review this, Thank you for the feedback.

Yes, please, I cannot understate how much time this would have saved me the past two days, and the organization I work for in the past two years.

I have uploaded a build of uwazi 1.42.0 on the release page, the upgrade process using this will depend on your local installation directories, i think that we need to work on proper instructions for this first, but feel free to try it.

daneryl commented 2 years ago

Feel free to reopen if the above comment did not solve the issue.