我正在尝试按照http://jhipster.github.io/installation.html的官方jhipster安装说明进行操作。我正在尝试安装Docker。我正在使用Linux Mint 17.1并安装了docker(Docker版本1.0.1,内置990021a)
我已成功拉出docker容器,使用提供的命令运行容器,然后ssh进入容器。
然而,当我试图运行“yo jhipster”时,我遇到了问题。它提示我标准生成器问题,然后成功创建项目本身所需的所有文件。接近生成器的末尾,在几次安装npm之后,我最终得到一条错误消息,然后是异常。
我不清楚此异常的来源或解决方法。官方文档没有提及有关此问题的任何内容,也未能找到有关此问题的任何其他报告。
我相信当我尝试启动项目时,导致此异常的任何事情似乎都会导致问题。我使用“mvn spring-boot:run”并且应用程序似乎运行,但是当我尝试访问网页时,我没有看到任何正常生成的“默认”应用程序,我期望。相反,我所看到的只是页面标题为“jhipster”,页面上唯一的文字“这是你的页脚”
以下是“yo jhipster”命令的输出(其中一些“创建”消息为空格编辑)
jhipster@234b4f2192fd:/jhipster$ yo jhipster
_ _ ___ __ _____ ____ ___ __ _____ __ __ _
| |_| | | | |_) ( (` | | | |_ | |_) ( (` | | / /\ / /` | |_/
|_| | |_| |_| _)_) |_| |_|__ |_| \ _)_) |_| /_/--\ \_\_, |_| \
____ ___ ___
| |_ / / \ | |_)
|_| \_\_/ |_| \
_ __ _ __ ___ ____ _ __
| | / /\ \ \ / / /\ | | \ | |_ \ \ / ( (`
\_|_| /_/--\ \_\/ /_/--\ |_|_/ |_|__ \_\/ _)_)
Welcome to the JHipster Generator
This is an existing project, using the configuration from your .yo-rc.json file
to re-generate the project...
create package.json
create bower.json
create README.md
identical .bowerrc
identical .gitignore
identical .gitattributes
create Gruntfile.js
create pom.xml
..........
create src/main/webapp/assets/images/development_ribbon.png
create src/main/webapp/assets/images/hipster.png
create src/main/webapp/assets/images/hipster2x.png
create src/main/webapp/index.html
identical .editorconfig
identical .jshintrc
I'm all done. Running bower install & npm install for you to install the required dependencies. If this fails, try running the command yourself.
npm WARN engine imagemin@3.1.0: wanted: {"node":">=0.10.0","npm":">=2.1.5"} (current: {"node":"0.10.33","npm":"1.4.28"})
npm WARN optional dep failed, continuing fsevents@0.3.5
> phantomjs@1.9.15 install /jhipster/node_modules/karma-phantomjs-launcher/node_modules/phantomjs
> node install.js
Download already available at /tmp/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2
Extracting tar contents (via spawned process)
Removing /jhipster/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom
Copying extracted folder /tmp/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2-extract-1425335692414/phantomjs-1.9.8-linux-x86_64 -> /jhipster/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom
Writing location.js file
Done. Phantomjs binary available at /jhipster/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/bin/phantomjs
> ws@0.5.0 install /jhipster/node_modules/grunt-browser-sync/node_modules/browser-sync/node_modules/socket.io/node_modules/engine.io/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
> ws@0.4.31 install /jhipster/node_modules/grunt-browser-sync/node_modules/browser-sync/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
> ws@0.4.32 install /jhipster/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
npm WARN optional dep failed, continuing imagemin-optipng@4.2.0
npm WARN optional dep failed, continuing imagemin-gifsicle@4.1.0
npm WARN optional dep failed, continuing imagemin-jpegtran@4.1.0
npm WARN optional dep failed, continuing imagemin-pngquant@4.0.0
npm WARN prefer global yo@1.3.3 should be installed with -g
> yo@1.3.3 postinstall /jhipster/node_modules/yo
> yodoctor
Yeoman Doctor
Running sanity checks on your system
✔ No .bowerrc file in home directory
✔ Global configuration file is valid
✔ No .yo-rc.json file in home directory
✔ NODE_PATH matches the npm root
Everything looks all right!
npm ERR! EEXIST, open '/home/jhipster/.npm/ebc17495-r-npm-minimist-1-1-0-package-tgz.lock'
File exists: /home/jhipster/.npm/ebc17495-r-npm-minimist-1-1-0-package-tgz.lock
Move it away, and try again.
npm ERR! System Linux 3.13.0-37-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! cwd /jhipster
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! path /home/jhipster/.npm/ebc17495-r-npm-minimist-1-1-0-package-tgz.lock
npm ERR! code EEXIST
npm ERR! errno 47
npm ERR! not ok code 0
events.js:72
throw er; // Unhandled 'error' event
^
Error: spawn ENOENT
at errnoException (child_process.js:1001:11)
at Process.ChildProcess._handle.onexit (child_process.js:792:34)
jhipster@234b4f2192fd:/jhipster$
答案 0 :(得分:1)
这似乎是JHipster Dockerfile的一个错误。我今天提交了pull request,其中更新了节点版本。使用更新的节点版本不再有问题。
您有两种选择:
从我的forked repository下载Dockerfile并使用与Dockerfile相同的目录中的以下命令自行构建映像
docker build -t yourusername/jhipster-docker .
sudo docker run -v ~/jhipster:/jhipster -p 8080:8080 -p 9000:9000 -p 35729:35729 -p 4022:22 -t yourusername/jhipster-docker
此docker run命令取自您之前提到的JHipster documentation页面。
答案 1 :(得分:0)
查看yo jhipster命令中的这些行
npm ERR! EEXIST, open '/home/jhipster/.npm/ebc17495-r-npm-minimist-1-1-0- package-tgz.lock'
File exists: /home/jhipster/.npm/ebc17495-r-npm-minimist-1-1-0-package-tgz.lock
Move it away, and try again.
所以删除.lock文件并再试一次
答案 2 :(得分:0)
尝试“> npm cache clean”并运行“> yo jhipster”..它应该有效。