Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
524 views
in Technique[技术] by (71.8m points)

c# - 跳过可选依赖项:[email protected]不受支持的平台:想要的{“ os”:“ darwin”,“ arch”:“ any”}(当前:{“ os”:“ win32”,“ arch”:“ x64” })(SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“win32”,“arch”:“x64”}))

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 . (我正在尝试安装Webpack,但它不断给我同样的警告,但仍然没有在我的项目中安装webpack。) It is an exiting project that im working with. (这是一个正在与我合作的退出项目。) I tried so many commands like (我尝试了很多命令)

npm install --no-optional (npm install-无可选)

npm install --global webpack (npm install --global webpack)

npm install --save-dev webpack (npm install --save-dev Webpack)

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

npm i -D webpack (npm i -D Webpack)

yarn add webpack --dev (纱线添加webpack --dev)

I tried deleting the node_modules on my project and installing them again but it still gives me the same warning (我尝试删除项目上的node_modules并再次安装它们,但仍然会给我同样的警告)

SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) (跳过可选的依赖关系:[email protected]不受支持的平台:通缉{“ os”:“ darwin”,“ arch”:“ any”}(当前:{“ os”:“ win32”,“ arch”:“ x64” }))

and the webpack is not installed. (并且未安装webpack。)

  ask by E.Lahu translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I had a problem with versions so i fixed it like this : I installet WebPack Installer (我的版本有问题,所以我这样解决了它:I installet WebPack Installer)

Node-sass should support NodeJs version look which nodeJs version supports node-sass : Link (Node-sass应该支持NodeJs版本,看看哪个nodeJs版本支持node-sass: 链接)

Delete node_modules folder in project and install again "npm install" in cmd (删除项目中的node_modules文件夹,然后在cmd中再次安装“ npm install”)

npm uninstall node-sass npm install [email protected] --- or the version which is supported for your NodeJs version (npm卸载node-sass npm install [email protected] ---或您的NodeJs版本支持的版本)

npm rebuild node-sass (npm重建节点ass)

This Fixed my problem which was with different versions of NodeJs and Node-sass (这解决了我的问题,即不同版本的NodeJ和Node-sass)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...