title: How do I switch from npm to yarn in my project?
body: <p>I'm having an issue trying to switch to yarn from npm inside my project. I tried downloading yarn and I'm still getting npm to start my project. I need to switch because a project I'm working on needs it to be yarn so I can add a maven frontend plugin to tie my backend and frontend to gather for deployment.</p>
  <p><a href="https://i.stack.imgur.com/WpXPM.png" rel="noreferrer"><img src="https://i.stack.imgur.com/WpXPM.png" alt="enter image description here" /></a></p>
  <pre><code>1.
  &lt;frontend-maven-plugin.version&gt;1.6&lt;/frontend-maven-plugin.version&gt;
  &lt;node.version&gt;v10.13.0&lt;/node.version&gt;
  &lt;yarn.version&gt;v1.12.1&lt;/yarn.version&gt;
  
  2.
  &lt;profiles&gt;
      &lt;profile&gt;
          &lt;id&gt;demo&lt;/id&gt;
          &lt;build&gt;
              &lt;plugins&gt;
  
                  &lt;plugin&gt;
                      &lt;groupId&gt;com.github.eirslett&lt;/groupId&gt;
                      &lt;artifactId&gt;frontend-maven-plugin&lt;/artifactId&gt;
                      &lt;version&gt;${frontend-maven-plugin.version}&lt;/version&gt;
                      &lt;configuration&gt;
                          &lt;workingDirectory&gt;src/js&lt;/workingDirectory&gt;
                      &lt;/configuration&gt;
                      &lt;executions&gt;
                          &lt;execution&gt;
                              &lt;id&gt;install node&lt;/id&gt;
                              &lt;goals&gt;
                                  &lt;goal&gt;install-node-and-yarn&lt;/goal&gt;
                              &lt;/goals&gt;
                              &lt;configuration&gt;
                                  &lt;nodeVersion&gt;${node.version}&lt;/nodeVersion&gt;
                                  &lt;yarnVersion&gt;${yarn.version}&lt;/yarnVersion&gt;
                              &lt;/configuration&gt;
                          &lt;/execution&gt;
                          &lt;execution&gt;
                              &lt;id&gt;yarn install&lt;/id&gt;
                              &lt;goals&gt;
                                  &lt;goal&gt;yarn&lt;/goal&gt;
                              &lt;/goals&gt;
                              &lt;phase&gt;generate-resources&lt;/phase&gt;
                          &lt;/execution&gt;
                          &lt;execution&gt;
                              &lt;id&gt;yarn test&lt;/id&gt;
                              &lt;goals&gt;
                                  &lt;goal&gt;yarn&lt;/goal&gt;
                              &lt;/goals&gt;
                              &lt;phase&gt;test&lt;/phase&gt;
                              &lt;configuration&gt;
                                  &lt;arguments&gt;test&lt;/arguments&gt;
                                  &lt;environmentVariables&gt;
                                      &lt;CI&gt;true&lt;/CI&gt;
                                  &lt;/environmentVariables&gt;
                              &lt;/configuration&gt;
                          &lt;/execution&gt;
                          &lt;execution&gt;
                              &lt;id&gt;yarn build&lt;/id&gt;
                              &lt;goals&gt;
                                  &lt;goal&gt;yarn&lt;/goal&gt;
                              &lt;/goals&gt;
                              &lt;phase&gt;compile&lt;/phase&gt;
                              &lt;configuration&gt;
                                  &lt;arguments&gt;build&lt;/arguments&gt;
                              &lt;/configuration&gt;
                          &lt;/execution&gt;
                      &lt;/executions&gt;
                  &lt;/plugin&gt;
                  &lt;plugin&gt;
                      &lt;artifactId&gt;maven-resources-plugin&lt;/artifactId&gt;
                      &lt;executions&gt;
                          &lt;execution&gt;
                              &lt;id&gt;copy-resources&lt;/id&gt;
                              &lt;phase&gt;process-classes&lt;/phase&gt;
                              &lt;goals&gt;
                                  &lt;goal&gt;copy-resources&lt;/goal&gt;
                              &lt;/goals&gt;
                              &lt;configuration&gt;
                                  &lt;outputDirectory&gt;${basedir}/target/classes/static&lt;/outputDirectory&gt;
                                  &lt;resources&gt;
                                      &lt;resource&gt;
                                          &lt;directory&gt;src/js/build&lt;/directory&gt;
                                      &lt;/resource&gt;
                                  &lt;/resources&gt;
                              &lt;/configuration&gt;
                          &lt;/execution&gt;
                      &lt;/executions&gt;
                  &lt;/plugin&gt;
              &lt;/plugins&gt;
          &lt;/build&gt;
      &lt;/profile&gt;
  &lt;/profiles&gt;
  </code></pre>
  <p>Link1
  <a href="https://github.com/amigoscode/spring-boot-react-fullstack/blob/app-0/course-files/profiles.txt" rel="noreferrer">https://github.com/amigoscode/spring-boot-react-fullstack/blob/app-0/course-files/profiles.txt</a>
  Link2
  <a href="https://github.com/eirslett/frontend-maven-plugin" rel="noreferrer">https://github.com/eirslett/frontend-maven-plugin</a></p>