当在Android设备中运行我的本机项目时,我得到了一个错误。
我已经试过很多东西了。去除node_modules,clear npm cache,纱线,使用纱线和npm安装,不要解决它。
这是怎么回事?
错误:无法从
node\_modules/multer/lib/multer-error.js:util解析模块util,无法在项目中找到。如果您确定模块存在,请尝试以下步骤: 1.清除看守手表-del-all 2.删除node_modules: rm -rf node_modules并运行纱线安装3.重置metro的缓存:开始-重置-缓存4.删除缓存: rm -rf /tmp/‘s*
已经尝试了错误信息中显示的建议。
package.json
{
"name": "svm",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"@react-native-community/datetimepicker": "^2.3.2",
"@react-native-community/masked-view": "^0.1.6",
"@react-navigation/drawer": "^5.4.0",
"axios": "^0.19.2",
"formik": "^2.1.4",
"moment": "^2.24.0",
"native-base": "^2.13.8",
"react": "16.9.0",
"react-native": "^0.62.2",
"react-native-elements": "^1.2.7",
"react-native-ftp": "^1.0.1",
"react-native-gesture-handler": "^1.5.6",
"react-native-image-picker": "^2.3.1",
"react-native-linear-gradient": "^2.5.6",
"react-native-masked-text": "^1.13.0",
"react-native-reanimated": "^1.7.0",
"react-native-safe-area-context": "^0.7.2",
"react-native-screens": "^2.0.0-beta.2",
"react-native-sound": "^0.11.0",
"react-native-vector-icons": "^6.6.0",
"react-native-youtube": "^2.0.1",
"react-navigation": "^4.1.1",
"ssh2-sftp-client": "^5.1.2",
"styled-components": "^5.0.1",
"yup": "^0.28.1"
},
"devDependencies": {
"@babel/core": "^7.6.2",
"@babel/runtime": "^7.6.2",
"@react-native-community/eslint-config": "^0.0.5",
"babel-jest": "^24.9.0",
"eslint": "^6.5.1",
"jest": "^24.9.0",
"metro-react-native-babel-preset": "^0.56.0",
"multer": "^1.4.2",
"multer-sftp": "^1.1.0",
"react-test-renderer": "16.9.0"
},
"jest": {
"preset": "react-native"
}
}发布于 2020-07-09 09:35:45
Multer被列为dev依赖项。我想你在测试的时候已经为生产开发了这个应用程序。所以包没有装载。
将"multer":"^1.4.2“依赖项从"devDependencies”移到“依赖项”可能会解决这个问题。
https://stackoverflow.com/questions/62441099
复制相似问题