title: An unexpected error occurred: "/Users/name/package.json: Unexpected token \\ in JSON at position 1" not a similar question
body: <p>So I was running yarn command and got this error no matter what project i was in.</p>
  <blockquote>
  <p>error An unexpected error occurred: &quot;/Users/name/package.json:
  Unexpected token \ in JSON at position 1&quot;.</p>
  <blockquote>
  <p>Trace:    SyntaxError: /Users/name/package.json: Unexpected token \ in JSON at position 1
  at JSON.parse ()
  at /usr/local/Cellar/yarn/1.22.5/libexec/lib/cli.js:1625:59
  at Generator.next ()
  at step (/usr/local/Cellar/yarn/1.22.5/libexec/lib/cli.js:310:30)
  at /usr/local/Cellar/yarn/1.22.5/libexec/lib/cli.js:321:13</p>
  </blockquote>
  </blockquote>
  <pre><code>#!/usr/bin/env node
  module.exports =
  /******/ (function(modules) { // webpackBootstrap
  /******/    // The module cache
  /******/    var installedModules = {};
  /******/
  /******/    // The require function
  /******/    function __webpack_require__(moduleId) {
  /******/
  /******/        // Check if module is in cache
  /******/
  </code></pre>
  <p>Package.json:</p>
  <pre><code> {
    &quot;name&quot;: &quot;vue-cli-sample&quot;,
    &quot;version&quot;: &quot;0.1.0&quot;,
    &quot;private&quot;: false,
    &quot;description&quot;: &quot;Sample project generated using Vue-CLI&quot;,
    &quot;author&quot;: &quot;Irfan Maulana &lt;github.com/mazipan&gt;&quot;,
    &quot;scripts&quot;: {
      &quot;serve&quot;: &quot;./node_modules/.bin/cross-env NODE_ENV=development vue-cli-service serve --host localhost&quot;,
      &quot;build&quot;: &quot;./node_modules/.bin/cross-env NODE_ENV=production vue-cli-service build&quot;,
      &quot;test&quot;: &quot;./node_modules/.bin/cross-env NODE_ENV=test jest --coverage&quot;,
      &quot;lint&quot;: &quot;vue-cli-service lint&quot;,
      &quot;dev&quot;: &quot;npm run serve&quot;,
      &quot;dist&quot;: &quot;npm run dist&quot;,
      &quot;test:unit&quot;: &quot;npm run test&quot;
    },
    &quot;dependencies&quot;: {
      &quot;bootstrap-vue&quot;: &quot;^2.16.0&quot;,
      &quot;intro.js&quot;: &quot;^2.9.3&quot;,
      &quot;parse-json&quot;: &quot;^2.2.0&quot;,
      &quot;register-service-worker&quot;: &quot;1.6.2&quot;,
      &quot;vue&quot;: &quot;2.6.10&quot;,
      &quot;vue-introjs&quot;: &quot;^1.3.2&quot;,
      &quot;vue-router&quot;: &quot;3.0.7&quot;,
      &quot;vuex&quot;: &quot;3.1.1&quot;,
      &quot;webpack&quot;: &quot;^4.44.1&quot;
    },
    &quot;devDependencies&quot;: {
      &quot;@vue/cli-plugin-babel&quot;: &quot;3.9.2&quot;,
      &quot;@vue/cli-plugin-eslint&quot;: &quot;3.9.2&quot;,
      &quot;@vue/cli-plugin-pwa&quot;: &quot;3.9.0&quot;,
      &quot;@vue/cli-service&quot;: &quot;3.9.2&quot;,
      &quot;@vue/eslint-config-standard&quot;: &quot;4.0.0&quot;,
      &quot;@vue/test-utils&quot;: &quot;1.0.0-beta.29&quot;,
      &quot;babel-core&quot;: &quot;7.0.0-bridge.0&quot;,
      &quot;babel-eslint&quot;: &quot;10.0.2&quot;,
      &quot;babel-jest&quot;: &quot;24.8.0&quot;,
      &quot;cross-env&quot;: &quot;5.2.0&quot;,
      &quot;eslint&quot;: &quot;6.0.1&quot;,
      &quot;eslint-plugin-import&quot;: &quot;2.18.0&quot;,
      &quot;eslint-plugin-node&quot;: &quot;9.1.0&quot;,
      &quot;eslint-plugin-promise&quot;: &quot;4.2.1&quot;,
      &quot;eslint-plugin-standard&quot;: &quot;4.0.0&quot;,
      &quot;eslint-plugin-vue&quot;: &quot;5.2.3&quot;,
      &quot;jest&quot;: &quot;24.8.0&quot;,
      &quot;jest-serializer-vue&quot;: &quot;2.0.2&quot;,
      &quot;jest-transform-stub&quot;: &quot;2.0.0&quot;,
      &quot;jest-watch-typeahead&quot;: &quot;0.3.1&quot;,
      &quot;less&quot;: &quot;3.9.0&quot;,
      &quot;less-loader&quot;: &quot;5.0.0&quot;,
      &quot;lint-staged&quot;: &quot;9.2.0&quot;,
      &quot;vue-jest&quot;: &quot;3.0.4&quot;,
      &quot;vue-template-compiler&quot;: &quot;2.6.10&quot;,
      &quot;webpack-dev-server&quot;: &quot;3.7.2&quot;
    },
    &quot;resolutions&quot;: {
      &quot;webpack-dev-server&quot;: &quot;3.7.2&quot;
    },
    &quot;bugs&quot;: {
      &quot;url&quot;: &quot;https://github.com/mazipan/vue-cli-sample/issues&quot;
    },
    &quot;gitHooks&quot;: {
      &quot;pre-commit&quot;: &quot;lint-staged&quot;
    },
    &quot;license&quot;: &quot;MIT&quot;,
    &quot;lint-staged&quot;: {
      &quot;*.{js,vue}&quot;: [
        &quot;vue-cli-service lint --fix&quot;,
        &quot;git add&quot;
      ]
    },
    &quot;repository&quot;: {
      &quot;type&quot;: &quot;git&quot;,
      &quot;url&quot;: &quot;https://github.com/mazipan/vue-cli-sample.git&quot;
    }
  }
  </code></pre>
  <p>My yarn version v1.22.5
  I have both node version 12 and 15 it uses 15 as default</p>