无法从node_modules \ uuidv4 \ build \ lib \ uuidv4.js解析模块util:在项目内找不到util

如何解决无法从node_modules \ uuidv4 \ build \ lib \ uuidv4.js解析模块util:在项目内找不到util

我已经更新了package.json中的模块,现在出现错误“无法从node_modules \ uuidv4 \ build \ lib \ uuidv4.js解析模块util:在项目内找不到util。 “

在以下步骤中,我已经完成了#2的操作。我没有为#1使用watchman,而是为#3使用npm而不是yarn,并且我不知道#4指的是什么路径。这是我的完整输出。

PS C:\ Dev \ myProj> react-native bundle --platform android --dev false --entry-file index.js --bundle-output android / app / src / main / assets / index.android。捆绑--assets-dest android / app / src / main / res /

(节点:16148)警告:在循环依赖中访问模块导出的不存在的属性“ padLevels” (使用node --trace-warnings ...显示警告的创建位置) 欢迎使用React Native! 学习一次,随处写

错误无法解析util中的模块node_modules\uuidv4\build\lib\uuidv4.js:在项目中找不到util。

如果确定模块存在,请尝试以下步骤:

  1. 清除守望者手表:守望者全部手表
  2. 删除node_modules:rm -rf node_modules并运行yarn install
  3. 重置Metro的缓存:yarn start --reset-cache
  4. 删除高速缓存:rm -rf / tmp / metro- *。使用--verbose标志运行CLI以获取更多详细信息。 错误:无法解析util中的模块node_modules\uuidv4\build\lib\uuidv4.js:在项目中找不到util。

如果确定模块存在,请尝试以下步骤:

  1. 清除守望者手表:守望者全部手表
  2. 删除node_modules:rm -rf node_modules并运行yarn install
  3. 重置Metro的缓存:yarn start --reset-cache
  4. 删除缓存:rm -rf / tmp / metro- * 在ModuleResolver.resolveDependency(C:\ Dev \ myProj \ node_modules \ metro \ src \ node-haste \ DependencyGraph \ ModuleResolution.js:186:15) 在ResolutionRequest.resolveDependency(C:\ Dev \ myProj \ node_modules \ metro \ src \ node-haste \ DependencyGraph \ ResolutionRequest.js:52:18) 在DependencyGraph.resolveDependency(C:\ Dev \ myProj \ node_modules \ metro \ src \ node-haste \ DependencyGraph.js:287:16) 在Object.resolve(C:\ Dev \ myProj \ node_modules \ metro \ src \ lib \ transformHelpers.js:267:42) 在C:\ Dev \ myProj \ node_modules \ metro \ src \ DeltaBundler \ traverseDependencies.js:434:31 在Array.map() 在resolveDependencies(C:\ Dev \ myProj \ node_modules \ metro \ src \ DeltaBundler \ traverseDependencies.js:431:18) 在C:\ Dev \ myProj \ node_modules \ metro \ src \ DeltaBundler \ traverseDependencies.js:275:33 在Generator.next() 在asyncGeneratorStep(C:\ Dev \ myProj \ node_modules \ metro \ src \ DeltaBundler \ traverseDependencies.js:87:24)

这是我的package.json文件

{
  "name": "myproj","version": "0.0.1","private": true,"scripts": {
    "start": "react-native start","prettier": "prettier --write '*.js' 'src/**/*.js'","test": "jest","lint": "eslint .","android": " cd android && ./gradlew clean && cd .. && react-native run-android","ios": "react-native run-ios"
  },"dependencies": {
    "@react-native-community/async-storage": "^1.11.0","@react-native-community/cameraroll": "^4.0.0","@react-native-community/geolocation": "^2.0.2","@react-native-community/masked-view": "^0.1.10","@react-native-firebase/app": "^8.3.1","@react-native-firebase/auth": "^8.3.3","@react-native-firebase/messaging": "^7.7.1","@skele/components": "^1.0.0-alpha.40","axios": "^0.19.2","base-64": "^0.1.0","crypto-js": "^4.0.0","expo-av": "~8.4.0","expo-blur": "^8.1.2","expo-camera": "^8.3.1","expo-constants": "~9.1.1","expo-facebook": "~8.2.1","expo-file-system": "^9.1.0","expo-firebase-recaptcha": "^1.1.3","expo-image-picker": "~8.4.0","expo-localization": "~8.2.1","expo-location": "~8.3.0","expo-permissions": "^9.1.0","firebase": "7.18.0","formik": "^2.1.5","i18n-js": "^3.7.1","invert-color": "^2.0.0","jest-haste-map": "^26.3.0","jest-serializer": "^26.3.0","jest-worker": "^26.3.0","lodash": "^4.17.20","lodash.isequal": "^4.5.0","lodash.memoize": "^4.1.2","mobx": "^5.15.6","mobx-react": "^6.2.5","moment": "^2.27.0","oauth-1.0a": "^2.2.6","react": "16.13.1","react-native": "0.63.2","react-native-actionsheet": "^2.4.2","react-native-animatable": "^1.3.3","react-native-app-intro-slider": "^4.0.4","react-native-appearance": "~0.3.4","react-native-autogrow-textinput": "^5.4.0","react-native-button": "^3.0.1","react-native-confirmation-code-field": "^6.5.0","react-native-dialog-input": "^1.0.8","react-native-fast-image": "^8.3.2","react-native-fbsdk": "2.0.0","react-native-geocoding": "^0.4.0","react-native-gesture-handler": "^1.7.0","react-native-get-random-values": "^1.4.0","react-native-google-places-autocomplete": "^1.8.0","react-native-image-crop-picker": "^0.32.2","react-native-image-filter-kit": "^0.7.3","react-native-image-picker": "^2.3.3","react-native-image-progress": "^1.1.1","react-native-image-view": "^2.1.9","react-native-indicators": "^0.17.0","react-native-iphone-x-helper": "^1.2.1","react-native-keyboard-aware-scroll-view": "^0.9.2","react-native-keyboard-aware-view": "0.0.14","react-native-keyboard-input": "^6.0.2","react-native-keyboard-tracking-view": "^5.7.0","react-native-localize": "^1.4.1","react-native-maps": "0.27.1","react-native-modal": "^11.5.6","react-native-modal-patch": "git+https://github.com/HarvestProfit/react-native-modal-patch.git","react-native-modalbox": "^2.0.0","react-native-phone-input": "^0.2.4","react-native-popup-menu": "^0.15.9","react-native-progress": "^4.1.2","react-native-reanimated": "^1.13.0","react-native-safe-area-context": "^3.1.4","react-native-screens": "^2.10.1","react-native-search-box": "0.0.19","react-native-slider": "^0.11.0","react-native-splash-screen": "^3.2.0","react-native-swiper": "^1.6.0-nightly.5","react-native-unimodules": "^0.10.1","react-native-vector-icons": "7.0.0","react-native-video": "^5.0.2","react-native-view-more-text": "^2.1.0","react-native-webview": "^10.7.0","react-navigation": "^4.4.0","react-navigation-drawer": "^2.5.0","react-navigation-redux-helpers": "^4.0.1","react-navigation-stack": "^2.8.2","react-navigation-tabs": "^2.9.0","react-redux": "^7.2.1","redux": "^4.0.5","redux-logger": "^3.0.6","redux-thunk": "^2.3.0","remote-redux-devtools": "^0.5.16","uuidv4": "^6.2.2"
  },"devDependencies": {
    "@babel/core": "^7.11.1","@babel/plugin-proposal-decorators": "^7.10.5","@babel/runtime": "^7.11.2","@react-native-community/eslint-config": "^2.0.0","babel-jest": "^26.3.0","babel-plugin-transform-remove-console": "^6.9.4","eslint": "7.7.0","jest": "^26.4.0","metro-react-native-babel-preset": "^0.62.0","prettier": "2.0.5","react-test-renderer": "16.13.1"
  },"jest": {
    "preset": "react-native"
  }
}

解决方法

我不得不回滚:

“ uuidv4”:“ ^ 5.0.1”

,

搜索您在项目中导入“uuidv4”的位置并将其删除。

,

从项目中删除 node-modules 文件夹,然后 运行npm-install 生成它再次。这对我有用。

,

这里提供的答案都不适合我。我试过了

  • 恢复为“uuidv4”:“^5.0.1”
  • 恢复为“uuidv4”:“^3.0.1”
  • 删除 node_modules 文件夹,然后运行 ​​npm i

为我修复的是使用此 UUID 生成代替 https://www.npmjs.com/package/react-native-uuid

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


依赖报错 idea导入项目后依赖报错,解决方案:https://blog.csdn.net/weixin_42420249/article/details/81191861 依赖版本报错:更换其他版本 无法下载依赖可参考:https://blog.csdn.net/weixin_42628809/a
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下 2021-12-03 13:33:33.927 ERROR 7228 [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPL
错误1:gradle项目控制台输出为乱码 # 解决方案:https://blog.csdn.net/weixin_43501566/article/details/112482302 # 在gradle-wrapper.properties 添加以下内容 org.gradle.jvmargs=-Df
错误还原:在查询的过程中,传入的workType为0时,该条件不起作用 <select id="xxx"> SELECT di.id, di.name, di.work_type, di.updated... <where> <if test=&qu
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct redisServer’没有名为‘server_cpulist’的成员 redisSetCpuAffinity(server.server_cpulist); ^ server.c: 在函数‘hasActiveC
解决方案1 1、改项目中.idea/workspace.xml配置文件,增加dynamic.classpath参数 2、搜索PropertiesComponent,添加如下 <property name="dynamic.classpath" value="tru
删除根组件app.vue中的默认代码后报错:Module Error (from ./node_modules/eslint-loader/index.js): 解决方案:关闭ESlint代码检测,在项目根目录创建vue.config.js,在文件中添加 module.exports = { lin
查看spark默认的python版本 [root@master day27]# pyspark /home/software/spark-2.3.4-bin-hadoop2.7/conf/spark-env.sh: line 2: /usr/local/hadoop/bin/hadoop: No s
使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams['font.sans-serif'] = ['SimHei'] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -> systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping("/hires") public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate<String
使用vite构建项目报错 C:\Users\ychen\work>npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-