0

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. :)

Danny Ellis Jr.
  • 1,674
  • 2
  • 23
  • 38
  • When you reinstalled npm, did you install it globally? like this `npm install npm -g` – Paul Kaspriskie Feb 23 '17 at 13:59
  • Yes, npm, webpack, and webpack-dev-server are the only things I installed globally, however. Is that the problem? – Danny Ellis Jr. Feb 23 '17 at 14:41
  • No, that is not a problem. I just wanted to make sure you were updating it globally. Can you run `npm --version` to verify it updated. – Paul Kaspriskie Feb 23 '17 at 14:49
  • The npm version is actually shown in the error message. v3.10.10. I am away from the computer at the moment but I will check it as soon as I can get back there. – Danny Ellis Jr. Feb 23 '17 at 18:37
  • Oh right, Sorry I didn't catch that. It appears to me that postcss-loader 3.2.0 is not compatible with npm v3.10. The version of postcss-loader is to new for npm v3.10 . I will post an answer below on how to fix it. – Paul Kaspriskie Feb 23 '17 at 20:26

1 Answers1

0

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
Paul Kaspriskie
  • 201
  • 2
  • 5
  • This got me past the immediate problem but appears to be causing compatibility issues elsewhere. I will have to spin my wheels on the new problems for awhile. – Danny Ellis Jr. Feb 23 '17 at 23:45