在旧项目上升级jhipster版本

时间:2017-07-11 07:41:57

标签: git upgrade jhipster

我有一个旧的jhipster项目是使用版本3.9.1(最初)生成的,在再次处理之后我想要的第一件事是将jhipster升级到最新版本,因为已经有很多改进。

我克隆了回购,安装了所有必要的东西并试图运行该项目。一切正常!然后我在项目的根文件夹上运行yo jhipster:upgrade。在一些权限问题和一些丢失的软件包之后,它最终进行了升级,但是版本为3.12.2而不是4.6.1(最新版)。

此时我不得不解决一些冲突才能让项目再次运行,没问题。我检查了它和我的包装的版本" generator-jhipster"确实是4.6.1(最新)。

我尝试过几次运行升级过程,甚至强制使用--target-version=4.6.1版本,但升级后看似顺利,项目仍然在jhipster 3.12.2上运行。

我在这里尝试了解决方案Jhipster yo jhipster is not updating existing project但没有运气。

我做错了什么?或者成功升级的步骤是什么? jhipster网站上的升级页面非常含糊......

以下是典型的升级日志:

   Welcome to the JHipster Upgrade Sub-Generator
    This will upgrade your current application codebase to the latest JHipster version
    Looking for latest generator-jhipster version...
    New generator-jhipster version found: 4.6.1
    Git repository detected
    Updating generator-jhipster. This might take some time...
    Updated generator-jhipster to version 4.6.1
    Checked out branch "jhipster_upgrade"
    Cleaned up directory
    Regenerating app with jhipster 4.6.1...

            ██  ██    ██  ████████  ███████    ██████  ████████  ████████  ███████
            ██  ██    ██     ██     ██    ██  ██          ██     ██        ██    ██
            ██  ████████     ██     ███████    █████      ██     ██████    ███████
      ██    ██  ██    ██     ██     ██             ██     ██     ██        ██   ██
       ██████   ██    ██  ████████  ██        ██████      ██     ████████  ██    ██

                                http://jhipster.github.io

    Welcome to the JHipster Generator v3.12.2
    Documentation for creating an application: https://jhipster.github.io/creating-an-app/
    Application files will be generated in folder: C:\Users\quosei\Documents\GitHub\Agora
     ______________________________________________________________________________

      JHipster update available: 4.6.1 (current: 3.12.2)
      Run npm install -g generator-jhipster to update.
     ______________________________________________________________________________

    This is an existing project, using the configuration from your .yo-rc.json file
    to re-generate the project...

    [A LOT OF FILE CHANGES (SKIPPED FOR READABILITY)]

    Successfully regenerated app with jhipster 4.6.1
    Committed with message "Generated with JHipster 4.6.1"
    Checked out branch "master"
    Merging changes back to master...
    Merge done!

    I'm all done. Running npm install && bower install for you to install the required dependencies. If this fails, try running the command yourself.

    [NPM INSTALL && BOWER INSTALL RUN WITHOUT PROBLEM (SKIPPED FOR READABILITY)]

    > yodoctor


    Yeoman Doctor
    Running sanity checks on your system

    √ Global configuration file is valid
    √ NODE_PATH matches the npm root
    √ Node.js version
    √ No .bowerrc file in home directory
    √ No .yo-rc.json file in home directory
    √ npm version

    Everything looks all right!

    > optipng-bin@3.1.4 postinstall C:\Users\quosei\Documents\GitHub\Agora\node_modules\optipng-bin
    > node lib/install.js

      √ optipng pre-build test passed successfully

    > jpegtran-bin@3.2.0 postinstall C:\Users\quosei\Documents\GitHub\Agora\node_modules\jpegtran-bin
    > node lib/install.js

      √ jpegtran pre-build test passed successfully

    > gifsicle@3.0.4 postinstall C:\Users\quosei\Documents\GitHub\Agora\node_modules\gifsicle
    > node lib/install.js

      √ gifsicle pre-build test passed successfully

    > spawn-sync@1.0.15 postinstall C:\Users\quosei\Documents\GitHub\Agora\node_modules\spawn-sync
    > node postinstall

    added 1485 packages in 101.329s
    [09:45:32] Using gulpfile ~\Documents\GitHub\Agora\gulpfile.js
    [09:45:32] Starting 'install'...
    [09:45:32] Starting 'inject:test'...
    [09:45:33] Starting 'inject:vendor'...
    [09:45:33] Starting 'ngconstant:dev'...
    [09:45:33] Finished 'install' after 177 ms
    [09:45:33] Finished 'ngconstant:dev' after 122 ms
    [09:45:33] gulp-inject 33 files into karma.conf.js.
    [09:45:33] gulp-inject 36 files into index.html.
    [09:45:33] Finished 'inject:test' after 261 ms
    [09:45:33] Finished 'inject:vendor' after 202 ms
    [09:45:33] Starting 'inject:dep'...
    [09:45:33] Finished 'inject:dep' after 6.74 μs
    [09:45:33] Starting 'copy:languages'...
    [09:45:33] Finished 'copy:languages' after 9.7 ms
    [09:45:33] Starting 'inject:app'...
    [09:45:33] gulp-inject 205 files into index.html.
    [09:45:33] Finished 'inject:app' after 319 ms
    [09:45:33] Starting 'inject:troubleshoot'...
    [09:45:33] gulp-inject Nothing to inject into index.html.
    [09:45:33] Finished 'inject:troubleshoot' after 12 ms

    Upgraded successfully. Please now fix conflicts if any, and commit!

非常感谢!

1 个答案:

答案 0 :(得分:0)

JHipster升级问题

如果不起作用

yarn global upgrade generator-jhipster

然后

yarn global add generator-jhipster yarn global upgrade generator-jhipster  或

yo