【问题标题】:JHipster prod build not able to createJHipster 产品构建无法创建
【发布时间】:2018-05-18 22:29:52
【问题描述】:

使用通过 JHipster 生成的新代码创建产品构建时出现以下错误 用户以下选项: 1.单体应用
2.是否要使用JHipster Registry进行配置--否
3.JWT认证
4. 带磁盘持久化的H2数据库
5.无缓存
6 行家
7. 使用spring的websockets
8. 角度 4
9. 没有 css 处理器
10.没有国际
11. 没有测试框架
12.没有其他发电机

在 Windows 上使用以下命令
mvnw -Pprod

此命令也在本地安装节点和纱线

[INFO] [4/4] Building fresh packages...
[ERROR] error D:\ws\15_sep\node_modules\spawn-sync: Command failed.
[INFO] info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
[ERROR] Exit code: 1
[ERROR] Command: C:\WINDOWS\system32\cmd.exe
[ERROR] Arguments: /d /s /c node postinstall
[ERROR] Directory: D:\ws\15_sep\node_modules\spawn-sync
[ERROR] Output:
[ERROR] module.js:471
[ERROR]     throw err;
[ERROR]     ^
[ERROR]
[ERROR] Error: Cannot find module 'D:\ws\15_sep\node_modules\spawn-sync\postinstall'
[ERROR]     at Function.Module._resolveFilename (module.js:469:15)
[ERROR]     at Function.Module._load (module.js:417:25)
[ERROR]     at Module.runMain (module.js:604:10)
[ERROR]     at run (bootstrap_node.js:389:7)
[ERROR]     at startup (bootstrap_node.js:149:9)
[ERROR]     at bootstrap_node.js:504:3

【问题讨论】:

    标签: node.js npm jhipster npm-install


    【解决方案1】:

    目前我可以通过首先运行以下命令来运行开发构建来创建构建战争文件

       npm install
    

    然后从 pom.xml 文件中的 prod 配置文件中删除以下执行 然后运行产品构建

                          <execution>
                                    <id>install node and yarn</id>
                                    <goals>
                                        <goal>install-node-and-yarn</goal>
                                    </goals>
                                    <configuration>
                                        <nodeVersion>${node.version}</nodeVersion>
                                        <yarnVersion>${yarn.version}</yarnVersion>
                                    </configuration>
                                </execution>
                                <execution>
                                    <id>yarn install</id>
                                    <goals>
                                        <goal>yarn</goal>
                                    </goals>
                                    <configuration>
                                        <arguments>install</arguments>
                                    </configuration>
                                </execution>
    

    然后运行产品构建

    mvnw -Pprod
    

    【讨论】:

    • 我很困惑,你为什么在你的 pom 中使用 npm install 然后再使用纱线?把它们混在一起通常是个坏主意
    猜你喜欢
    • 1970-01-01
    • 2019-05-14
    • 1970-01-01
    • 2019-06-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多