React-native使用语音识别失败
Rainbow_4869 发布于2021-04 浏览:1088 回复:1
0
收藏

通过npm install baidu-aip-sdk导入到项目中,在android中运行报下面的错

Error: Unable to resolve module crypto from G:\IdeaProjects\chairApp\node_modules\baidu-aip-sdk\src\http\httpClientVoiceASR.js: crypto could not be found within the project or in these directories:
node_modules

If you are sure the module exists, try these steps:
1. Clear watchman watches: watchman watch-del-all
2. Delete node_modules and run yarn install
3. Reset Metro's cache: yarn start --reset-cache
4. Remove the cache: rm -rf /tmp/metro-*
17 |
18 | const HttpClient = require('./httpClient');
> 19 | const crypto = require('crypto');

但是在项目中已经导入crypto相关包,该怎么办呢

收藏
点赞
0
个赞
共1条回复 最后由用户已被禁言回复于2022-04
#2franklyn867回复于2021-04

android 建议直接使用android sdk  https://ai.baidu.com/sdk#asr

0
TOP
切换版块