File tree Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " react-native-update-cli" ,
3- "version" : " 2.3.1 " ,
3+ "version" : " 2.3.2 " ,
44 "description" : " command line tool for react-native-update (remote updates for react native)" ,
55 "main" : " index.js" ,
66 "bin" : {
Original file line number Diff line number Diff line change @@ -85,14 +85,30 @@ async function runReactNativeBundleCommand({
8585
8686 const getExpoCli = ( ) => {
8787 try {
88+ const searchPaths = [ process . cwd ( ) ] ;
89+
90+ // 尝试添加 expo 包的路径作为额外的搜索路径
91+ try {
92+ const expoPath = require . resolve ( 'expo/package.json' , {
93+ paths : [ process . cwd ( ) ] ,
94+ } ) ;
95+ // 获取 expo 包的目录路径
96+ const expoDir = expoPath . replace ( / \/ p a c k a g e \. j s o n $ / , '' ) ;
97+ searchPaths . push ( expoDir ) ;
98+ } catch {
99+ // expo 包不存在,忽略
100+ }
101+
102+ // 尝试从搜索路径中解析 @expo/cli
88103 cliPath = require . resolve ( '@expo/cli' , {
89- paths : [ process . cwd ( ) ] ,
104+ paths : searchPaths ,
90105 } ) ;
106+
91107 const expoCliVersion = JSON . parse (
92108 fs
93109 . readFileSync (
94110 require . resolve ( '@expo/cli/package.json' , {
95- paths : [ process . cwd ( ) ] ,
111+ paths : searchPaths ,
96112 } ) ,
97113 )
98114 . toString ( ) ,
You can’t perform that action at this time.
0 commit comments