eirslett / frontend-maven-plugin

"Maven-node-grunt-gulp-npm-node-plugin to end all maven-node-grunt-gulp-npm-plugins." A Maven plugin that downloads/installs Node and NPM locally, runs NPM install, Grunt, Gulp and/or Karma.
Apache License 2.0
4.2k stars 867 forks source link

yarnrc in user home #1084

Open delanym opened 1 year ago

delanym commented 1 year ago

I spent today finding the cause of [ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.12.1:yarn (yarn install) on project mywebapp: Failed to run task: 'yarn ' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1) -> [Help 1]

and this issue with line 218 of the parse.js https://github.com/yarnpkg/yarn/issues/613

With config

        <plugin>
          <groupId>com.github.eirslett</groupId>
          <artifactId>frontend-maven-plugin</artifactId>
          <version>1.12.1</version>
          <configuration>
            <installDirectory>${git.dir.worktree}/target/apps</installDirectory>
            <nodeVersion>v18.16.0</nodeVersion>
            <yarnVersion>v1.22.19</yarnVersion>
            <nodeDownloadRoot>https://rego/repository/nodejs.org_dist/</nodeDownloadRoot>
            <yarnDownloadRoot>https://rego/repository/github.com_yarnpkg_yarn_releases_download/</yarnDownloadRoot>
            <serverId>presto-public</serverId>
            <skip>false</skip>
          </configuration>
          <executions>
            <execution>
              <id>install node and yarn</id>
              <goals>
                <goal>install-node-and-yarn</goal>
              </goals>
            </execution>
            <execution>
              <id>yarn install</id>
              <goals>
                <goal>yarn</goal>
              </goals>
            </execution>
            <execution>
              <id>yarn set proxy</id>
              <goals>
                <goal>yarn</goal>
              </goals>
              <configuration>
                <arguments>config set httpProxy https://rego/repository/npmjs/</arguments>
              </configuration>
            </execution>
          </executions>
        </plugin>

It seems this file was to blame ~/.yarnrc. It was probably corrupted after the machine lost power during a build. After removing it I could rebuild.

Why is this file being written to the user home folder? That puts it out of control of the clean phase.