npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents
程序员文章站
2022-05-29 23:46:41
...
场景重现
npm install --verbose
安装依赖的时,出现如下警告
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS: darwin
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch: any
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS: win32
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
释疑
这不是什么真的有问题,只是你的某些包依赖fsevents
包,而fsevents
包是MacOS系统下,在Windows/Linux下会提示警告,但不会安装.
解决办法
但是强迫症患者表示不能接受,换个角度看释疑,意味着fsevents
在MacOS下是必须的,而在Windows/Linux下是可选的.
那么我们可以通过package.json
的optionalDependencies
来规避警告,然后npm install --no-optional --verbose
不安装可选项即可.
参考如下:
{
"dependencies": {
"axios": "^0.18.0",
"echarts": "^4.2.0-rc.2",
"element-ui": "^2.4.11",
"screenfull": "^3.3.3",
"vue": "^2.5.17",
"vue-router": "^3.0.1",
"vuex": "^3.0.1"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^3.0.5",
"@vue/cli-service": "^3.0.5",
"less": "^3.0.4",
"less-loader": "^4.1.0",
"vue-template-compiler": "^2.5.17"
},
"optionalDependencies": {
"fsevents": "*"
}
}
转载于:https://my.oschina.net/taadis/blog/2988809
上一篇: npm install 失败 operation not permitted, scandir 'E:\vue-test\node_modules\fsevents\node_modules'
下一篇: Git时出现“error: 源引用表达式 main 没有匹配 error: 推送一些引用到 ‘https://github.com/***.git‘ 失败”的错误提示
推荐阅读
-
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os"
-
在项目中 npm i报错 npm WARN optional SKIPPING OPTIONAL DEPENDENCY
-
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents
-
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents
-
【记录bug】npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsvents): npm WA...
-
npm报错:npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents): npm WA
-
错误解决:webpack---optional SKIPPING OPTIONAL DEPENDENCY: fsevents...
-
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
-
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents
-
npm install 警告npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules)