ไม่สามารถแก้ไข util โมดูลจาก node_modules \ uuidv4 \ build \ lib \ uuidv4.js: util ไม่พบในโปรเจ็กต์
ฉันได้อัปเดตโมดูลของฉันใน package.json และตอนนี้ฉันได้รับข้อผิดพลาด "ไม่สามารถแก้ไข util โมดูลจาก node_modules \ uuidv4 \ build \ lib \ uuidv4.js: ไม่พบ util ภายในโปรเจ็กต์"
จากขั้นตอนด้านล่างนี้ฉันได้ทำข้อที่ 2 แล้ว ฉันไม่ได้ใช้ watchman สำหรับ # 1 ฉันใช้ npm แทนเส้นด้ายสำหรับ # 3 และฉันไม่รู้ว่าเส้นทาง # 4 หมายถึงอะไร นี่คือผลลัพธ์ทั้งหมดของฉัน
PS C: \ Dev \ myProj> กลุ่ม react-native --platform android --dev false --entry-file index.js --bundle-output android / app / src / main / assets / index.android.bundle - android / app / src / main / res / สินทรัพย์ปลายทาง /
(node: 16148) คำเตือน: การเข้าถึงคุณสมบัติ 'padLevels' ที่ไม่มีอยู่จริงของการเอ็กซ์พอร์ตโมดูลภายในการอ้างอิงแบบวงกลม (ใช้node --trace-warnings ...
เพื่อแสดงตำแหน่งที่สร้างคำเตือน) ยินดีต้อนรับสู่ React Native! เรียนรู้ครั้งเดียวเขียนได้ทุกที่
ข้อผิดพลาดไม่สามารถแก้ไขโมดูลutil
จากnode_modules\uuidv4\build\lib\uuidv4.js
: ไม่พบ util ในโครงการ
หากคุณแน่ใจว่ามีโมดูลอยู่ให้ลองทำตามขั้นตอนเหล่านี้:
- นาฬิกายามที่ชัดเจน: watchman watch-del-all
- ลบ node_modules: rm -rf node_modules และรันการติดตั้งเส้นด้าย
- รีเซ็ตแคชของ Metro: เส้นด้ายเริ่มต้น - รีเซ็ตแคช
- ลบแคช: rm -rf / tmp / metro- * เรียกใช้ CLI ด้วย --verbose flag สำหรับรายละเอียดเพิ่มเติม ข้อผิดพลาด: ไม่สามารถแก้ไขโมดูล
util
จากnode_modules\uuidv4\build\lib\uuidv4.js
: ไม่พบ util ภายในโปรเจ็กต์
หากคุณแน่ใจว่ามีโมดูลอยู่ให้ลองทำตามขั้นตอนเหล่านี้:
- นาฬิกายามที่ชัดเจน: watchman watch-del-all
- ลบ node_modules: rm -rf node_modules และรันการติดตั้งเส้นด้าย
- รีเซ็ตแคชของ Metro: เส้นด้ายเริ่มต้น - รีเซ็ตแคช
- ลบแคช: 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 () ที่ resolutionDependencies (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"
ลบโฟลเดอร์โหนดโมดูลออกจากโปรเจ็กต์ของคุณและหลังจากนั้นให้รัน npm-installเพื่อสร้างอีกครั้ง สิ่งนี้ได้ผลสำหรับฉัน