Skip to content

ERROR POSTCSS: failed to transform "/scss/main.css" (text/css): Error: Loading PostCSS Plugin failed: Cannot find module 'autoprefixer' #2083

Closed Answered by deining
jpanico asked this question in Q&A
Discussion options

You must be logged in to vote

This issue was already raised in #1586.
From your logs I can see you installed autoprefixer and postcss globally, but docsy expects them locally, this may be the cause for your troubles.

Possible solution: can you please check if there is a `package.json in the root directory of your site? If not, can you please run:

npm init

Then answer the questions in the command line questionnaire.
Afterwards, issue:

npm install -D autoprefixer
npm install -D postcss-cli

Now you should be able to successfully run:

hugo server

Can you please try that and report back whether this cures your problem?

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jpanico
Comment options

Answer selected by chalin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants