소스 검색

cli: Improve error if global anchor not found (#996)

Tom Linton 3 년 전
부모
커밋
e22eb4c3d7
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      cli/npm-package/anchor.js

+ 5 - 0
cli/npm-package/anchor.js

@@ -72,6 +72,11 @@ function trySystemAnchor() {
       return true;
     });
 
+  if (!absolutePath) {
+    console.error(`Could not find globally installed anchor, install with cargo.`);
+    process.exit();
+  }
+
   const absoluteBinaryPath = `${absolutePath}/anchor`;
 
   const [error, binaryVersion] = getBinaryVersion(absoluteBinaryPath);