我必须维护 jhipster v3.0 Web 应用程序。
我知道这个版本不再受支持,但也许你们中的一些人遇到过这个问题并且能够帮助我。
我已经安装了 Node、NPM、Yo、Bower 和 GULP。
当我在 web 应用程序上运行 mvn -Pprod package -Dmaven.test.skip=true
时,出现此错误:
[INFO] node version :
v8.10.0
[INFO] npm version :
5.6.0
[INFO] --------------------------------------
[INFO] NPM INSTALL
[INFO] --------------------------------------
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
up to date in 5.803s
[INFO] bower version :
1.8.2
[INFO] --------------------------------------
[INFO] BOWER INSTALL --NO-COLOR
[INFO] --------------------------------------
bower invalid-meta for:/home/myapp/Documents/workspaces/aprhmyapp/bower.json
bower invalid-meta The "name" is recommended to be lowercase, can contain digits, dots, dashes
bower angular-cookies extra-resolution Unnecessary resolution: angular-cookies#1.5.2
[INFO] gulp version :
[14:17:21] CLI version 3.9.1
[14:17:21] Local version 3.9.1
[INFO] --------------------------------------
[INFO] GULP TEST --NO-COLOR
[INFO] --------------------------------------
[14:17:22] Using gulpfile ~/Documents/workspaces/aprhmyapp/gulpfile.js
[14:17:22] Starting 'wiredep:test'...
[14:17:22] Starting 'ngconstant:dev'...
[14:17:22] 'ngconstant:dev' errored after 29 ms
[14:17:22] Error in plugin 'gulp-tslint-log'
TypeError: Path must be a string. Received null
at assertPath (path.js:28:11)
at Object.dirname (path.js:1349:5)
at getFilePath (/home/myapp/Documents/workspaces/aprhmyapp/node_modules/gulp-ng-constant-fork/index.js:95:27)
at DestroyableTransform.objectStream [as _transform] (/home/myapp/Documents/workspaces/aprhmyapp/node_modules/gulp-ng-constant-fork/index.js:60:25)
at DestroyableTransform.Transform._read (/home/myapp/Documents/workspaces/aprhmyapp/node_modules/gulp-ng-constant-fork/node_modules/readable-stream/lib/_stream_transform.js:184:10)
at DestroyableTransform.Transform._write (/home/myapp/Documents/workspaces/aprhmyapp/node_modules/gulp-ng-constant-fork/node_modules/readable-stream/lib/_stream_transform.js:172:12)
at doWrite (/home/myapp/Documents/workspaces/aprhmyapp/node_modules/gulp-ng-constant-fork/node_modules/readable-stream/lib/_stream_writable.js:237:10)
at writeOrBuffer (/home/myapp/Documents/workspaces/aprhmyapp/node_modules/gulp-ng-constant-fork/node_modules/readable-stream/lib/_stream_writable.js:227:5)
at DestroyableTransform.Writable.write (/home/myapp/Documents/workspaces/aprhmyapp/node_modules/gulp-ng-constant-fork/node_modules/readable-stream/lib/_stream_writable.js:194:11)
at DestroyableTransform.Writable.end (/home/myapp/Documents/workspaces/aprhmyapp/node_modules/gulp-ng-constant-fork/node_modules/readable-stream/lib/_stream_writable.js:352:10)
at ngConstantPlugin (/home/myapp/Documents/workspaces/aprhmyapp/node_modules/gulp-ng-constant-fork/index.js:33:16)
at Gulp.<anonymous> (/home/myapp/Documents/workspaces/aprhmyapp/gulpfile.js:164:12)
at module.exports (/home/myapp/Documents/workspaces/aprhmyapp/node_modules/orchestrator/lib/runTask.js:34:7)
at Gulp.Orchestrator._runTask (/home/myapp/Documents/workspaces/aprhmyapp/node_modules/orchestrator/index.js:273:3)
at Gulp.Orchestrator._runStep (/home/myapp/Documents/workspaces/aprhmyapp/node_modules/orchestrator/index.js:214:10)
at Gulp.Orchestrator.start (/home/myapp/Documents/workspaces/aprhmyapp/node_modules/orchestrator/index.js:134:8)
最佳答案
您使用的 Node 版本太新:v8.10.0。
在 JHipster 3 的时候,可能是 Node 4.x,尝试降级并考虑使用 Node 环境管理器来轻松切换版本。
此外,请考虑编辑 pom.xml
以将 yeoman-maven-plugin 替换为 frontend-maven-plugin,这使您能够指定 Node 和相关工具(npm、bower、gulp)的版本,以将您的产品构建与开发环境隔离。这就是 JHipster 4 使用的。
关于node.js - 吉普斯特 : issue with mvn package,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49512722/