瀏覽代碼

Fix node_modules removal

Steven Silvester 7 年之前
父節點
當前提交
4ae3c78201
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      jupyterlab/commands.py

+ 2 - 1
jupyterlab/commands.py

@@ -222,7 +222,8 @@ def install_extension_async(extension, app_dir=None, logger=None, abort_callback
     # Remove any existing package from staging/node_modules to force
     # npm to re-install it from the tarball.
     target = pjoin(app_dir, 'staging', 'node_modules', data['name'])
-    shutil.rmtree(target)
+    if os.path.exists(target):
+        shutil.rmtree(target)
 
 
 def link_package(path, app_dir=None, logger=None):