2
votes

Im trying to install Webpack but it keeps giving me the same warning over and over and still webpack it's not installed in my project . It is an exiting project that im working with. I tried so many commands like

npm install --no-optional

npm install --global webpack

npm install --save-dev webpack

npm install i -g --save-dev webpack webpack-dev-server

npm i -D webpack

yarn add webpack --dev

I tried deleting the node_modules on my project and installing them again but it still gives me the same warning

SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

and the webpack is not installed.

2
That warning shouldn't prevent webpack from installing. As it says, its an optional dependency. There's likely something else going on here. - James Coyle

2 Answers

2
votes

I had a problem with versions so i fixed it like this : I installet WebPack Installer

Node-sass should support NodeJs version look which nodeJs version supports node-sass : Link

Delete node_modules folder in project and install again "npm install" in cmd

npm uninstall node-sass npm install [email protected] --- or the version which is supported for your NodeJs version

npm rebuild node-sass

This Fixed my problem which was with different versions of NodeJs and Node-sass

0
votes

alternatively, you can use yarn

npm i yarn
yarn install