File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
packages/remix-dev/devServer_unstable Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,17 @@ let patchPublicPath = (
35
35
} ;
36
36
} ;
37
37
38
+ let detectBin = async ( ) : Promise < string > => {
39
+ let pkgManager = detectPackageManager ( ) ?? "npm" ;
40
+ if ( pkgManager === "npm" ) {
41
+ // npm v9 removed the `bin` command, so have to use `prefix`
42
+ let { stdout } = await execa ( pkgManager , [ "prefix" ] ) ;
43
+ return stdout . trim ( ) + "/node_modules/.bin" ;
44
+ }
45
+ let { stdout } = await execa ( pkgManager , [ "bin" ] ) ;
46
+ return stdout . trim ( ) ;
47
+ } ;
48
+
38
49
export let serve = async (
39
50
initialConfig : RemixConfig ,
40
51
options : {
@@ -58,8 +69,7 @@ export let serve = async (
58
69
prevManifest ?: Manifest ;
59
70
} = { } ;
60
71
61
- let pkgManager = detectPackageManager ( ) ?? "npm" ;
62
- let bin = ( await execa ( pkgManager , [ "bin" ] ) ) . stdout . trim ( ) ;
72
+ let bin = await detectBin ( ) ;
63
73
let startAppServer = ( command : string ) => {
64
74
console . log ( `> ${ command } ` ) ;
65
75
return execa . command ( command , {
You can’t perform that action at this time.
0 commit comments