Search code examples
node.jspostcss

Cannot install postcss-loader


I'm really new to webpack, react, babel, etc. I had this working at one time, but I screwed something up and now I can't seem to fix it back. I have tried to get this to work for days now. The only guidance I have been able to find says update npm and node, and that guidance was two years old. Also, I have the latest versions of both.

Can someone tell me what I might be doing wrong, or better still how to not use postcss? Maybe a library that does the same thing? Perhaps a list of everything I need to install and in the proper order?

$ npm install postcss-loader --save-dev
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Program Files
(x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "postcss-loader"
  "--save-dev"
npm ERR! node v6.9.5
npm ERR! npm  v3.10.10
npm ERR! code ETARGET

npm ERR! notarget No compatible version found: postcss-loader@^3.2.0
npm ERR! notarget Valid install targets:

npm ERR! notarget 1.3.1, 1.3.0, 1.2.2, 1.2.1, 1.2.0, 1.1.1, 1.1.0, 1.0.0, 
0.13.0, 0.12.0, 0.11.1, 0.11.0, 0.10.1, 0.10.0, 0.9.1, 0.9.0, 0.8.2, 0.8.1, 
0.8.0, 0.7.0, 0.6.0, 0.5.1, 0.5.0, 0.4.4, 0.4.3, 0.4.2, 0.4.1, 0.4.0, 0.3.0,
0.2.0, 0.1.0
npm ERR! notarget
npm ERR! notarget This is most likely not a problem with npm itself.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

PS. As a career MS developer, I have the utmost respect for those of you who can be productive in this stack. I don't know how you people live like this. :)


Solution

  • To solve your problem. I think you just have to edit your package.json and specify an acceptable version of postcss-loader. I would suggest to use the most recent of 1.3.1. So within your package.json specify the version like this:

    "devDependencies": {
        "postcss": "^5.2.10",
        "postcss-loader": "^1.3.1"
      },
    

    Then try running the install once more and see what happens.

    npm install postcss-loader --save-dev