Prettier-atom: Cannot read property 'sync' of undefined

Created on 21 Apr 2018  路  2Comments  路  Source: prettier/prettier-atom

This started out of the blue a few days ago. It happens on every save. Any help would be greatly appreciated.

Debug info:

Atom version: 1.26.0
prettier-atom version: 0.53.0
prettier: bundled
prettier version: 1.11.1
prettier-eslint version: 8.8.1
prettier-atom configuration: {
  "formatOnSaveOptions": {
    "enabled": true,
    "showInStatusBar": true,
    "respectEslintignore": true,
    "excludedGlobs": [],
    "whitelistedGlobs": [],
    "isDisabledIfNotInPackageJson": false,
    "isDisabledIfNoConfigFile": false
  },
  "useEslint": true,
  "useStylelint": false,
  "useEditorConfig": true,
  "prettierOptions": {
    "singleQuote": false,
    "bracketSpacing": true,
    "semi": true,
    "useTabs": false,
    "jsxBracketSameLine": false,
    "printWidth": 80,
    "tabWidth": "auto",
    "trailingComma": "none",
    "parser": "babylon",
    "arrowParens": "avoid"
  },
  "prettierEslintOptions": {
    "prettierLast": false
  },
  "scopes": {
    "javascript": [
      "source.js",
      "source.jsx",
      "source.js.jsx",
      "source.babel",
      "source.js-semantic",
      "text.html.basic",
      "text.html.vue"
    ],
    "typescript": [
      "source.ts",
      "source.tsx",
      "source.ts.tsx"
    ],
    "css": [
      "source.css",
      "source.less",
      "source.css.less",
      "source.scss",
      "source.css.scss",
      "source.css.postcss"
    ],
    "json": [
      "source.json"
    ],
    "graphQl": [
      "source.graphql"
    ],
    "markdown": [
      "source.md",
      "source.gfm",
      "text.md"
    ],
    "vue": [
      "text.html.vue"
    ]
  }
}

troubleshooting

Most helpful comment

This happens when you use an extremely outdated version of prettier. We're probably picking up prettier in your node modules. Try installing prettier in your package.json and make sure it's the latest version.

All 2 comments

This happens when you use an extremely outdated version of prettier. We're probably picking up prettier in your node modules. Try installing prettier in your package.json and make sure it's the latest version.

That's it! Thank you so much!

Was this page helpful?
0 / 5 - 0 ratings