uglify错误:找不到模块“乐观主义者”

问题描述

我要uglify index.js文件。但这会引发此错误:找不到模块“乐观主义者”。

我已经安装了乐观主义者:npm install optimist但它不起作用。有人可以帮忙吗?

import IconFA from 'react-native-vector-icons/FontAwesome';

<View style={{
  position:'relative',justifyContent:'center',alignItems:'center',width:40,height:40,backgroundColor:'black'
}}>
  <IconFA name='circle-thin' size={40} color='grey'/>
  <IconFA name='plus' size={20} color='white' style={{position: 'absolute',zIndex: 99}} />  
</View>

解决方法

我强烈建议您尝试以下代码:-

uglifyjs index.js -o index.min.js
,

尝试此命令,

npm i optimist --save

如果它不起作用,请尝试一下,

删除node_modules文件夹和package-lock.json &然后尝试此命令,

npm i --save

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...