I get stuck with ‘mvn openmrs-sdk:create-project’. I have upgraded npm and node.js, but now I get a response below. What should I do to fix it?
[ERROR] C:\Users\barba\IdeaProjects\OpenMRS\openmrs-core\openmrs-core\node\node_modules\yo\node_modul
es\yeoman-doctor\lib\index.js:12
[ERROR] (async () => {
[ERROR] ^
[ERROR]
[ERROR] SyntaxError: Unexpected token (
[ERROR] at createScript (vm.js:56:10)
[ERROR] at Object.runInThisContext (vm.js:97:10)
[ERROR] at Module._compile (module.js:549:28)
[ERROR] at Object.Module._extensions…js (module.js:586:10)
[ERROR] at Module.load (module.js:494:32)
[ERROR] at tryModuleLoad (module.js:453:12)
[ERROR] at Function.Module._load (module.js:445:3)
[ERROR] at Module.require (module.js:504:17)
[ERROR] at require (internal/module.js:20:19)
[ERROR] at Object. (C:\Users\barba\IdeaProjects\OpenMRS\openmrs-core\openmrs-core\node
\node_modules\yo\node_modules\yeoman-doctor\lib\cli.js:3:1)
[INFO] C:\Users\barba\IdeaProjects\OpenMRS\openmrs-core\openmrs-core\node
[ERROR] npm ERR! Windows_NT 10.0.18362
[INFO] -- generator-openmrs-owa@2.0.0 [INFO] [ERROR] npm ERR! argv "C:\\Users\\barba\\IdeaProjects\\OpenMRS\\openmrs-core\\openmrs-core\\node\\nod e.exe" "C:\\Users\\barba\\IdeaProjects\\OpenMRS\\openmrs-core\\openmrs-core\\node\\node_modules\\npm\ \bin\\npm-cli.js" "install" "-g" "yo" "generator-openmrs-owa" "--no-optional" [ERROR] npm ERR! node v6.17.1 [ERROR] npm ERR! npm v3.10.10 [ERROR] npm ERR! code ELIFECYCLE [ERROR] [ERROR] npm ERR! yo@3.1.1 postinstall: yodoctor`
[ERROR] npm ERR! Exit status 1
[ERROR] npm ERR!
[ERROR] npm ERR! Failed at the yo@3.1.1 postinstall script ‘yodoctor’.
[ERROR] npm ERR! Make sure you have the latest version of node.js and npm installed.
[ERROR] npm ERR! If you do, this is most likely a problem with the yo package,
[ERROR] npm ERR! not with npm itself.
[ERROR] npm ERR! Tell the author that this fails on your system:
[ERROR] npm ERR! yodoctor
[ERROR] npm ERR! You can get information on how to open an issue for this project with:
[ERROR] npm ERR! npm bugs yo
[ERROR] npm ERR! Or if that isn’t available, you can get their info via:
[ERROR] npm ERR! npm owner ls yo
[ERROR] npm ERR! There is likely additional logging output above.
[ERROR]
[ERROR] npm ERR! Please include the following file with any support request:
[ERROR] npm ERR! C:\Users\barba\IdeaProjects\OpenMRS\openmrs-core\npm-debug.log
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for OpenMRS 2.4.0-SNAPSHOT:
[INFO]
[INFO] OpenMRS … FAILURE [02:48 min]
[INFO] openmrs-tools … SKIPPED
[INFO] openmrs-test … SKIPPED
[INFO] openmrs-api … SKIPPED
[INFO] openmrs-web … SKIPPED
[INFO] openmrs-webapp … SKIPPED
[INFO] openmrs-liquibase … SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:49 min
[INFO] Finished at: 2020-06-20T21:05:45+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:3.13.6:create-proje
ct (default-cli) on project openmrs: Unable to execute mojo: Failed to run task: ‘npm install -g yo g
enerator-openmrs-owa --no-optional’ failed. (error code 1) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following artic
les:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
I run this command manually and everything looks ok
$ npm install -g yo generator-openmrs-owa --no-optional
npm WARN deprecated generator-openmrs-owa@2.0.0: Package no longer supported. Please use the @openmrs
/generator-openmrs-owa package.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/reque
st/issues/3142
npm WARN deprecated cross-spawn-async@2.2.5: cross-spawn no longer requires a build toolchain, use it
instead
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
C:\Users\barba\AppData\Roaming\npm\yo -> C:\Users\barba\AppData\Roaming\npm\node_modules\yo\lib\cli.j
s
C:\Users\barba\AppData\Roaming\npm\yo-complete -> C:\Users\barba\AppData\Roaming\npm\node_modules\yo\
lib\completion\index.js
> core-js@3.6.5 postinstall C:\Users\barba\AppData\Roaming\npm\node_modules\yo\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"
Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standa
rd library!
The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock
Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
> ejs@2.7.4 postinstall C:\Users\barba\AppData\Roaming\npm\node_modules\yo\node_modules\ejs
> node ./postinstall.js
Thank you for installing EJS: built with the Jake JavaScript build tool (https://jakejs.com/)
> spawn-sync@1.0.15 postinstall C:\Users\barba\AppData\Roaming\npm\node_modules\yo\node_modules\spawn
-sync
> node postinstall
> yo@3.1.1 postinstall C:\Users\barba\AppData\Roaming\npm\node_modules\yo
> yodoctor
Yeoman Doctor
Running sanity checks on your system
√ No .bowerrc file in home directory
√ Global configuration file is valid
√ NODE_PATH matches the npm root
√ No .yo-rc.json file in home directory
√ Node.js version
√ npm version
√ yo version
(...)
Everything looks all right!
+ yo@3.1.1
+ generator-openmrs-owa@2.0.0
added 678 packages from 388 contributors in 85.237s
But I still have a problem with a setup project.
[ERROR] Failed to execute goal org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:3.13.6:setup (defau
lt-cli) on project openmrs: Failed to setup server: Failed to connect to the specified database jdbc:
mysql://localhost:3306/open_server?autoReconnect=true&sessionVariables=default_storage_engine%3DInnoD
B&useUnicode=true&characterEncoding=UTF-8 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following artic
les:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
I was connected by xampp, but I shut it down and reconnected by MySQL Workbench and now it works
Thanks!
I went to the next step (mvn clean install openmrs-sdk:run -DserverId=openMRS_server) and then:
[ERROR] Failed to execute goal com.mycila:license-maven-plugin:3.0:check (default) on project openmrs
: Some files do not have the expected license header -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following artic
les:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
But still have a problem with the connection to the database. MySQL is running. But I get a response like below and a lot of logs at my IDE, because of continuously refreshing.
@barbaratyndorf At this exact point you have to make sure that the data base is started,do you have the database started while running this step,ie are you able to login manually.According to your current logs it looks like your database is not running or its running on a different port