question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot use without Autoprefixer

See original GitHub issue

I don’t require or use autoprefixer in anywhere but I still get this error. When I still don’t use or require autoprefixer but install it, everything works fine.

module.js:341
    throw err;
    ^

Error: Cannot find module 'autoprefixer'
    at Function.Module._resolveFilename (module.js:339:15)
    at Function.Module._load (module.js:290:25)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at Object.autoprefixer (C:\somepath\node_modules\postcss-cssnext\lib\features.js:126:12)
    at C:\somepath\node_modules\postcss-cssnext\lib\index.js:70:44
    at Array.forEach (native)
    at C:\somepath\node_modules\postcss-cssnext\lib\index.js:56:35
    at creator (C:\somepath\node_modules\postcss\lib\postcss.js:60:39)
    at Function.postcss.plugin (C:\somepath\node_modules\postcss\lib\postcss.js:66:23)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:16 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
amilajackcommented, Jul 9, 2016

Try this:

npm cache clean
npm rb
npm i autoprefixer

Let me know what the output of this is.

0reactions
w0rmcommented, Oct 3, 2016

As mentioned earlier, autoprefixer is a dependency of postcss-cssnext plugin, so this issue is probably connected to windows environment and/or node/npm version, but not gulp-postcss, because it doesn’t have these dependencies.

Read more comments on GitHub >

github_iconTop Results From Across the Web

getting "Cannot find module 'autoprefixer'" error during setup ...
at first I faced “Cannot find module 'autoprefixer'” error during setup. than I tried "yarn" instead of "npm".
Read more >
Autoprefixer - Best of JS
PostCSS plugin to parse CSS and add vendor prefixes to CSS rules using values from Can I Use. It is recommended by Google...
Read more >
autoprefixer - npm
PostCSS plugin to parse CSS and add vendor prefixes to CSS rules using values from Can I Use. It is recommended by Google...
Read more >
autoprefixer | Yarn - Package Manager
It is recommended by Google and used in Twitter and Alibaba. Write your CSS rules without vendor prefixes (in fact, forget about them...
Read more >
An Introduction to PostCSS - SitePoint
Similarly, you can't stop developers using options you'd rather avoid ... PostCSS is not necessarily faster or more lightweight than using a ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found