【问题标题】:Npm install failed with “EINVAL: invalid argument, chown”Npm 安装失败,出现“EINVAL:无效参数,chown”
【发布时间】:2019-08-10 21:41:32
【问题描述】:

我正在使用frontend-maven-plugin 在 Java 项目中运行我的 Angular 应用程序,插件条目如下所示:

<plugin>
                <groupId>com.github.eirslett</groupId>
                <artifactId>frontend-maven-plugin</artifactId>
                <version>1.3</version>

                <configuration>
                    <nodeVersion>v6.10.3</nodeVersion>
                    <npmVersion>5.0.0</npmVersion>
                    <workingDirectory>src/main/ngapp</workingDirectory>
                </configuration>

                <executions>
                    <execution>
                        <id>install node and npm</id>
                        <goals>
                            <goal>install-node-and-npm</goal>
                        </goals>
                    </execution>

                    <execution>
                        <id>npm install</id>
                        <goals>
                            <goal>npm</goal>
                        </goals>
                    </execution>

                    <execution>
                        <id>npm run build</id>
                        <goals>
                            <goal>npm</goal>
                        </goals>

                        <configuration>
                            <arguments>run build</arguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

我的 mvn clean package 命令在我的 本地环境 中运行良好,但在我的 jenkins 配置的服务器上失败,并显示以下错误消息。

[ERROR] npm ERR! path /code/src/main/ngapp/node_modules/.staging/@ngtools/json-schema-5dca9490
[ERROR] npm ERR! code EINVAL
[ERROR] npm ERR! errno -22
[ERROR] npm ERR! syscall chown
[ERROR] npm ERR! EINVAL: invalid argument, chown '/code/src/main/ngapp/node_modules/.staging/@ngtools/json-schema-5dca9490'

注意:相同的配置直到昨天都运行良好,但从早上开始就坏了。

【问题讨论】:

    标签: java angular maven npm


    【解决方案1】:

    升级到最新的节点/npm。

    您可以尝试以下..应该可以工作。

    <configuration>
           <nodeVersion>v11.12.0</nodeVersion>
           <npmVersion>6.7.0</npmVersion>
    </configuration>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-05-11
      • 2016-02-27
      • 1970-01-01
      • 2021-09-23
      • 2015-01-17
      • 2016-11-08
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多