Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example config leads to an error (Must install one of: '+libs.join()) #80

Closed
folmert opened this issue Jul 1, 2016 · 4 comments
Closed

Comments

@folmert
Copy link

folmert commented Jul 1, 2016

I merged the example from Usage instructions with my webpack.config.js:

var precss       = require('precss');
var autoprefixer = require('autoprefixer');

module.exports = {
    module:  {
        loaders: [
            {
                test:   /\.css$/,
                loader: "style-loader!css-loader!postcss-loader"
            }
        ]
    },
    entry:   ["./entry.js",
        './analytics.js'
    ],
    output:  {
        filename: "./bundleAnalytics.js"
    },
    watch:   true,
    postcss: function () {
        return [precss, autoprefixer];
    }
};

but when I try to run webpack it returns:

[my project's path]\node_modules\precss\node_modules\postcss-partial-import\node_modules\fs-promise\node_modules\any-promise\any-promise.js:32
  throw new Error('Must install one of: '+libs.join());
        ^
Error: Must install one of: es6-promise,promise,native-promise-only,bluebird,rsvp,when,q
    at [my project's path]\node_modules\precss\node_modules\postcss-partial-import\node_modules\fs-promise\node_modules\any-promise\any-promise.js:32:9
    at Object.<anonymous> ([my project's path]\node_modules\precss\node_modules\postcss-partial-import\node_modules\fs-promise\node_modules\any-promise\any-promise.js:33:3)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> ([my project's path]\node_modules\precss\node_modules\postcss-partial-import\node_modules\fs-promise\index.js:4:12)
    at Module._compile (module.js:456:26)
@ai
Copy link
Contributor

ai commented Jul 1, 2016

Please show me node -v output?

@folmert
Copy link
Author

folmert commented Jul 1, 2016

v0.10.26

After running npm update the output's still the same, so I assume it's the newest version...?

Installing: npm install es6-promise helped me to get rid of this error.

But I still don't get it how it works.

Now your CSS files requirements will be processed by selected PostCSS plugins:
var css = require('./file.css');

Where I put this var css and what does it do?
If I put it in one of my .js files where exactly this file.css will be appended?
Edit: nvm, I see it now at the end of the <head>

@ai
Copy link
Contributor

ai commented Jul 1, 2016

You should update your node.js. Current version is 6.0 ;).

@ai ai closed this as completed Jul 1, 2016
@ai
Copy link
Contributor

ai commented Jul 1, 2016

postcss-loder will compile CSS, that you will use in webpack.

So when you write require('./some/path/to/style.css') it will be processed by PostCSS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants