[英]No files matching the pattern were found: "'**/*.js'"
I downloaded expo project source code from github and tried to install node_module.我从 github 下载了 expo 项目源代码并尝试安装 node_module。 But I got following issue.
但是我遇到了以下问题。
[error] No files matching the pattern were found: "'**/*.js'". [错误] 未找到与该模式匹配的文件:“'**/*.js'”。 error Command failed with exit code 2. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
错误命令失败,退出代码为 2。 info 访问https://yarnpkg.com/en/docs/cli/run以获取有关此命令的文档。 error Command failed with exit code 2.
error 命令失败,退出代码为 2。
My node version is 14.15.1 expo version: 4.0.8 react-native-cli: 2.0.1我的节点版本是 14.15.1 expo 版本:4.0.8 react-native-cli: 2.0.1
and I will share my package.json file我将分享我的 package.json 文件
{
"private": true,
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"eject": "expo eject",
"postinstall": "yarn prettier && yarn lint",
"prettier": "npx prettier --write '**/*.js'",
"lint": "eslint --ignore-path .gitignore --ignore-pattern \"!**/.*\" .",
"lint:fix": "eslint --ignore-path .gitignore --ignore-pattern \"!**/.*\" --fix ."
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.(js|jsx)": [
"yarn prettier",
"yarn lint:fix",
"git add"
]
},
"dependencies": {
"@babel/cli": "7.0.0",
"@babel/core": "^7.0.0",
"@babel/runtime": "7.0.0",
"@expo/vector-icons": "10.0.1",
"axios": "^0.18.0",
"babel-core": "^7.0.0-bridge.0",
"babel-plugin-inline-dotenv": "^1.2.2",
"concurrently": "^4.1.0",
"expo": "^37.0.0",
"expo-asset": "~6.0.0",
"expo-constants": "~6.0.0",
"expo-font": "~6.0.1",
"expo-google-app-auth": "^6.0.0",
"expo-image-picker": "~6.0.0",
"expo-location": "~6.0.0",
"expo-permissions": "~6.0.0",
"mobx": "^4.3.1",
"mobx-react": "^5.1.0",
"mobx-state-tree": "^3.7.0",
"moment": "^2.24.0",
"native-base": "^2.12.1",
"prop-types": "^15.6.2",
"react": "16.6.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-33.0.0.tar.gz",
"react-native-design-utility": "^0.0.30",
"react-native-gesture-handler": "~1.3.0",
"react-native-reanimated": "~1.1.0",
"react-native-tab-view": "^2.10.0",
"react-native-webview": "~5.12.0",
"react-navigation": "2.18.2",
"react-redux": "^6.0.1",
"redux": "^4.0.1",
"socket.io-client": "^2.2.0"
},
"devDependencies": {
"@babel/plugin-transform-runtime": "^7.4.0",
"babel-eslint": "^10.0.1",
"babel-plugin-transform-decorators-legacy": "^1.3.5",
"eslint": "^5.1.0",
"eslint-config-prettier": "^3.1.0",
"eslint-plugin-react": "^7.11.1",
"husky": "^1.1.2",
"lint-staged": "^7.3.0",
"schedule": "0.4.0"
}
}
How can I fix this issue?我该如何解决这个问题?
I'm not sure it works.我不确定它是否有效。 You can try to overwrite your prettier configuration like this
您可以尝试像这样覆盖您更漂亮的配置
"prettier": "prettier --write \"src/**/*.{js,jsx,tsx,ts}\""
Previous solution is really work.以前的解决方案确实有效。 Сan also be used without quotes:
Сan 也可以不带引号使用:
"prettier": "prettier --write src/**/*.{js,jsx,tsx,ts}"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.