Hướng dẫn uninstall nodejs - gỡ cài đặt nodejs

Kịch bản: Xóa NodeJS khi Windows không có mục nhập chương trình cho cài đặt nút của bạn

Tôi gặp phải một vấn đề trong đó phiên bản nodejs của tôi (0.10,26) không thể được gỡ cài đặt cũng không bị xóa, bởi vì các chương trình & tính năng trong windows 7 (còn gọi là thêm/xóa các chương trình) Không có tùy chọn để loại bỏ nó thiếu các khóa và tệp đăng ký thủ công.

Lệnh để xác minh phiên bản nodejs của bạn:

//install module (package)
npm install nodemailer		//example of install nodemailer module.

//install with version. Syntax: npm install @
npm install 

//detect version in range
npm install sax@">=0.1.0 <0.2.0"
0

Tôi đã cố gắng cài đặt phiên bản NodeJS được đề xuất mới nhất, nhưng nó đã thất bại khi kết thúc quá trình cài đặt và quay lại. Nhiều phiên bản của NodeJS cũng không thành công và trình cài đặt cũng cuộn chúng lại. Tôi không thể nâng cấp nodejs từ dòng lệnh vì tôi chưa cài đặt sudo.

Giải pháp: Sau khi dành vài giờ để khắc phục sự cố, bao gồm nâng cấp NPM, tôi quyết định cài đặt lại phiên bản chính xác của NodeJS trên hệ thống của mình, trên đầu cài đặt hiện có.

Giải pháp đó đã hoạt động, và nó đã cài đặt lại NodeJ mà không có bất kỳ lỗi nào. Tốt hơn nữa, nó cũng đã thêm một mục chính thức trong cuộc đối thoại ADD/Xóa các chương trình.added an official entry in Add/Remove Programs dialogue.

Bây giờ Windows đã nhận thức được cài đặt NodeJS bị lãng quên, tôi đã có thể gỡ cài đặt hoàn toàn phiên bản NodeJS hiện có của mình. Sau đó, tôi đã cài đặt thành công bản phát hành NodeJS được đề xuất mới nhất cho Nền tảng Windows (phiên bản 4.4.5 khi viết bài này) mà không cần khởi tạo trở lại.

Phải mất một thời gian để đạt được thành công, vì vậy tôi đang đăng bài này trong trường hợp nó giúp bất cứ ai khác có vấn đề tương tự.

Nội phân

  • 1 tổng hợp các lệNH Tổng hợp các lệnh cài đặt và hủy cài đặt cho node.js module
      • 1.0.1 Cyi Đêm mô -đun nút Cài đặt node module
        • 1.0.1.1 Build Node Module với Microsoft Studio Build node module với Microsoft Studio
      • 1.0.2 HủY CÀi ĐặT Mô -đun nút Hủy cài đặt node module

Tổng hợp các lệnh cào

Mô mô đun nút của nút Có rất nhiề

npm install

Mô -đun nút CÀi ĐặT

Ngo à mô mô mô, chỉ Đ ị, ch, chỉ Đ ị, bản Để nodejs tìm ra một Phiên bản tồn tại trong Khoảng bạn Đề Cử Sau Tham Khảo Các Cách Dùng lệNH

//install module (package)
npm install nodemailer		//example of install nodemailer module.

//install with version. Syntax: npm install @
npm install 

//detect version in range
npm install sax@">=0.1.0 <0.2.0"

Cài đặt module thiết lập phạm vi global có thể dùng ở mọi nơi. Khi Những module khác có thể cần sử dụng những module global đó. Khai báo thêm tham số

//install module (package)
npm install nodemailer		//example of install nodemailer module.

//install with version. Syntax: npm install @
npm install 

//detect version in range
npm install sax@">=0.1.0 <0.2.0"
1. VÍ dụ:

npm -g install node-gyp

Build node module với Microsoft Studio

Đối với những module được viết bằng c/c++ được build bằng msbuild.exe của thư viện Microsoft Framework, trong quá trình cài node module, bạn sẽ có thể gặp lỗi.

C:\Program Files\nodejs\node_modules\msnodesql>node-gyp build
gyp info it worked if it ends with ok
gyp info using 
gyp info using  | win32 | x64
gyp info spawn C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
gyp info spawn args [ 'build/binding.sln',
gyp info spawn args   '/clp:Verbosity=minimal',
gyp info spawn args   '/nologo',
gyp info spawn args   '/p:Configuration=Release;Platform=x64' ]
Building the projects in this solution one at a time. To enable parallel build, please add the   "/m" switch.

Nodejs sử dụng msbuild cũ, và máy tính của bạn đã nâng cấp lên MS2012, kết quả là không tìm thấy. Cho nên trong lệnh cài module bạn cần chỉ định thêm tham số phiên bản

//install module (package)
npm install nodemailer		//example of install nodemailer module.

//install with version. Syntax: npm install @
npm install 

//detect version in range
npm install sax@">=0.1.0 <0.2.0"
2. Ví dụ:

npm install --msvs_version=2012 

Hủy cài đặt node module

Để hủy cài đặt module ra khỏi ứng dụng nodejs, bạn sử dụng lệnh

//install module (package)
npm install nodemailer		//example of install nodemailer module.

//install with version. Syntax: npm install @
npm install 

//detect version in range
npm install sax@">=0.1.0 <0.2.0"
3. Xem các ví dụ sau:

//to uninstall module use syntax: npm uninstall . example:
npm uninstall unirest

//The --force argument will force npm to fetch remote resources even if a local copy exists on disk.
npm install sax --force

//You may combine multiple arguments, and even multiple types of arguments. For example:
npm install sax@">=0.1.0 <0.2.0" bench supervisor

Hãy cho mình biết suy nghĩ của bạn trong phần bình luận bên dưới bài viết này. Hãy theo dõi kênh chia sẻ kiến thức WordPress của Hoangweb trên Twitter và Facebook

Nếu bạn đọc một trong những bài đăng trước đây của tôi về cách cài đặt Node.js, có lẽ bạn đã nhận thấy có khá nhiều cách để cài đặt nó trên máy tính của bạn. Điều này có thể là từ một trình quản lý gói, từ mã nguồn hoặc từ phân phối nhị phân được biên dịch sẵn. Vì vậy, bạn sẽ làm gì khi bạn muốn gỡ cài đặt Node.js?

Ở đây tôi sẽ mô tả một vài cách bạn có thể gỡ cài đặt nó khỏi máy tính Mac OSX của bạn. Chỉ cần lưu ý rằng các lệnh này sẽ xóa thực thi nút và không nhất thiết là tất cả các dự án nút hoặc bộ đệm NPM.

Bằng tay

Nếu bạn đã cài đặt nút theo nguồn hoặc từ phân phối nhị phân thì bạn có thể sẽ phải xóa các tài nguyên có thể thực thi và các tài nguyên khác theo cách thủ công. Thật không may, điều này không dễ dàng vì có khá nhiều thư mục có chứa tài nguyên nút, như

//install module (package)
npm install nodemailer		//example of install nodemailer module.

//install with version. Syntax: npm install @
npm install 

//detect version in range
npm install sax@">=0.1.0 <0.2.0"
4 và
//install module (package)
npm install nodemailer		//example of install nodemailer module.

//install with version. Syntax: npm install @
npm install 

//detect version in range
npm install sax@">=0.1.0 <0.2.0"
5.

Để gỡ cài đặt hoàn toàn

//install module (package)
npm install nodemailer		//example of install nodemailer module.

//install with version. Syntax: npm install @
npm install 

//detect version in range
npm install sax@">=0.1.0 <0.2.0"
6 thực thi cũng như
//install module (package)
npm install nodemailer		//example of install nodemailer module.

//install with version. Syntax: npm install @
npm install 

//detect version in range
npm install sax@">=0.1.0 <0.2.0"
4, đây là một số hướng dẫn về những việc cần làm:

Lưu ý rằng không phải tất cả các thư mục được liệt kê ở đây có thể tồn tại trên hệ thống của bạn tùy thuộc vào phương thức cài đặt của bạn.

  • Xóa
    //install module (package)
    npm install nodemailer		//example of install nodemailer module.
    
    //install with version. Syntax: npm install @
    npm install 
    
    //detect version in range
    npm install sax@">=0.1.0 <0.2.0"
    
    6 và/hoặc
    //install module (package)
    npm install nodemailer		//example of install nodemailer module.
    
    //install with version. Syntax: npm install @
    npm install 
    
    //detect version in range
    npm install sax@">=0.1.0 <0.2.0"
    
    5 từ
    npm -g install node-gyp
    
    0
  • Xóa
    //install module (package)
    npm install nodemailer		//example of install nodemailer module.
    
    //install with version. Syntax: npm install @
    npm install 
    
    //detect version in range
    npm install sax@">=0.1.0 <0.2.0"
    
    6 và/hoặc
    //install module (package)
    npm install nodemailer		//example of install nodemailer module.
    
    //install with version. Syntax: npm install @
    npm install 
    
    //detect version in range
    npm install sax@">=0.1.0 <0.2.0"
    
    5 từ
    npm -g install node-gyp
    
    3
  • Xóa
    //install module (package)
    npm install nodemailer		//example of install nodemailer module.
    
    //install with version. Syntax: npm install @
    npm install 
    
    //detect version in range
    npm install sax@">=0.1.0 <0.2.0"
    
    6,
    npm -g install node-gyp
    
    5 và
    npm -g install node-gyp
    
    6 từ
    npm -g install node-gyp
    
    7
  • Xóa
    npm -g install node-gyp
    
    8 khỏi thư mục nhà của bạn (đây là cài đặt NPM của bạn, đừng xóa điều này nếu bạn có kế hoạch cài đặt lại nút ngay lập tức)
  • Xóa
    npm -g install node-gyp
    
    9 khỏi thư mục nhà của bạn
  • Xóa
    C:\Program Files\nodejs\node_modules\msnodesql>node-gyp build
    gyp info it worked if it ends with ok
    gyp info using 
    gyp info using  | win32 | x64
    gyp info spawn C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
    gyp info spawn args [ 'build/binding.sln',
    gyp info spawn args   '/clp:Verbosity=minimal',
    gyp info spawn args   '/nologo',
    gyp info spawn args   '/p:Configuration=Release;Platform=x64' ]
    Building the projects in this solution one at a time. To enable parallel build, please add the   "/m" switch.
    
    0 khỏi thư mục nhà của bạn
  • Xóa
    C:\Program Files\nodejs\node_modules\msnodesql>node-gyp build
    gyp info it worked if it ends with ok
    gyp info using 
    gyp info using  | win32 | x64
    gyp info spawn C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
    gyp info spawn args [ 'build/binding.sln',
    gyp info spawn args   '/clp:Verbosity=minimal',
    gyp info spawn args   '/nologo',
    gyp info spawn args   '/p:Configuration=Release;Platform=x64' ]
    Building the projects in this solution one at a time. To enable parallel build, please add the   "/m" switch.
    
    1 khỏi thư mục nhà của bạn
  • Xóa
    C:\Program Files\nodejs\node_modules\msnodesql>node-gyp build
    gyp info it worked if it ends with ok
    gyp info using 
    gyp info using  | win32 | x64
    gyp info spawn C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
    gyp info spawn args [ 'build/binding.sln',
    gyp info spawn args   '/clp:Verbosity=minimal',
    gyp info spawn args   '/nologo',
    gyp info spawn args   '/p:Configuration=Release;Platform=x64' ]
    Building the projects in this solution one at a time. To enable parallel build, please add the   "/m" switch.
    
    2 khỏi
    C:\Program Files\nodejs\node_modules\msnodesql>node-gyp build
    gyp info it worked if it ends with ok
    gyp info using 
    gyp info using  | win32 | x64
    gyp info spawn C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
    gyp info spawn args [ 'build/binding.sln',
    gyp info spawn args   '/clp:Verbosity=minimal',
    gyp info spawn args   '/nologo',
    gyp info spawn args   '/p:Configuration=Release;Platform=x64' ]
    Building the projects in this solution one at a time. To enable parallel build, please add the   "/m" switch.
    
    3
  • Xóa
    C:\Program Files\nodejs\node_modules\msnodesql>node-gyp build
    gyp info it worked if it ends with ok
    gyp info using 
    gyp info using  | win32 | x64
    gyp info spawn C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
    gyp info spawn args [ 'build/binding.sln',
    gyp info spawn args   '/clp:Verbosity=minimal',
    gyp info spawn args   '/nologo',
    gyp info spawn args   '/p:Configuration=Release;Platform=x64' ]
    Building the projects in this solution one at a time. To enable parallel build, please add the   "/m" switch.
    
    4 khỏi
    C:\Program Files\nodejs\node_modules\msnodesql>node-gyp build
    gyp info it worked if it ends with ok
    gyp info using 
    gyp info using  | win32 | x64
    gyp info spawn C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
    gyp info spawn args [ 'build/binding.sln',
    gyp info spawn args   '/clp:Verbosity=minimal',
    gyp info spawn args   '/nologo',
    gyp info spawn args   '/p:Configuration=Release;Platform=x64' ]
    Building the projects in this solution one at a time. To enable parallel build, please add the   "/m" switch.
    
    3
  • Xóa
    C:\Program Files\nodejs\node_modules\msnodesql>node-gyp build
    gyp info it worked if it ends with ok
    gyp info using 
    gyp info using  | win32 | x64
    gyp info spawn C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
    gyp info spawn args [ 'build/binding.sln',
    gyp info spawn args   '/clp:Verbosity=minimal',
    gyp info spawn args   '/nologo',
    gyp info spawn args   '/p:Configuration=Release;Platform=x64' ]
    Building the projects in this solution one at a time. To enable parallel build, please add the   "/m" switch.
    
    6 khỏi
    C:\Program Files\nodejs\node_modules\msnodesql>node-gyp build
    gyp info it worked if it ends with ok
    gyp info using 
    gyp info using  | win32 | x64
    gyp info spawn C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
    gyp info spawn args [ 'build/binding.sln',
    gyp info spawn args   '/clp:Verbosity=minimal',
    gyp info spawn args   '/nologo',
    gyp info spawn args   '/p:Configuration=Release;Platform=x64' ]
    Building the projects in this solution one at a time. To enable parallel build, please add the   "/m" switch.
    
    7
  • Xóa
    //install module (package)
    npm install nodemailer		//example of install nodemailer module.
    
    //install with version. Syntax: npm install @
    npm install 
    
    //detect version in range
    npm install sax@">=0.1.0 <0.2.0"
    
    6 khỏi
    C:\Program Files\nodejs\node_modules\msnodesql>node-gyp build
    gyp info it worked if it ends with ok
    gyp info using 
    gyp info using  | win32 | x64
    gyp info spawn C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
    gyp info spawn args [ 'build/binding.sln',
    gyp info spawn args   '/clp:Verbosity=minimal',
    gyp info spawn args   '/nologo',
    gyp info spawn args   '/p:Configuration=Release;Platform=x64' ]
    Building the projects in this solution one at a time. To enable parallel build, please add the   "/m" switch.
    
    9
  • Xóa
    //install module (package)
    npm install nodemailer		//example of install nodemailer module.
    
    //install with version. Syntax: npm install @
    npm install 
    
    //detect version in range
    npm install sax@">=0.1.0 <0.2.0"
    
    6 khỏi
    npm install --msvs_version=2012 
    
    1
  • Xóa
    //install module (package)
    npm install nodemailer		//example of install nodemailer module.
    
    //install with version. Syntax: npm install @
    npm install 
    
    //detect version in range
    npm install sax@">=0.1.0 <0.2.0"
    
    5 từ
    npm install --msvs_version=2012 
    
    3
  • Xóa
    //install module (package)
    npm install nodemailer		//example of install nodemailer module.
    
    //install with version. Syntax: npm install @
    npm install 
    
    //detect version in range
    npm install sax@">=0.1.0 <0.2.0"
    
    6 khỏi
    npm install --msvs_version=2012 
    
    5
  • Xóa
    npm install --msvs_version=2012 
    
    6 khỏi
    npm install --msvs_version=2012 
    
    7

Danh sách này nên bao gồm tất cả các tham chiếu đến nút trên hệ thống của bạn. Hãy nhớ rằng có thể có nhiều hơn. Vui lòng cho tôi biết nếu bạn tìm thấy bất kỳ người nào khác (và cách bạn cài đặt nút ban đầu)!

Homebrew

Phương pháp homebrew được cho là một trong những cách dễ nhất để có được nút bật và tắt hệ thống của bạn. Lệnh để loại bỏ nó đơn giản như lệnh để cài đặt nó. Giả sử bạn đã sử dụng

npm install --msvs_version=2012 
8 để cài đặt nó, chỉ cần thực hiện nó để loại bỏ nó:

$ brew uninstall node

Và đó là nó! Tất cả các dấu vết của thực thi sẽ biến mất khỏi hệ thống của bạn.

NVM

Trình quản lý phiên bản nút (NVM) gần như thuận tiện như homebrew, nhưng theo một cách khác. Nó cho phép bạn cài đặt nhiều phiên bản nút trên hệ thống của mình để bạn có thể dễ dàng chuyển từ cái này sang cái khác.

Cuối cùng, có lẽ bạn sẽ muốn loại bỏ một trong các phiên bản khi bạn hoàn thành nó. Và giống như homebrew, bạn có thể dễ dàng thực hiện việc này bằng cách sử dụng một lệnh tương tự như cách bạn đã cài đặt nó:

$ nvm uninstall 

Và một ví dụ đầy đủ về điều này có thể là một cái gì đó như:

$ nvm uninstall v0.12.2

Kiểm tra hướng dẫn thực hành của chúng tôi, thực tế để học Git, với các thực hành tốt nhất, các tiêu chuẩn được công nghiệp chấp nhận và bao gồm bảng gian lận. Ngừng các lệnh git googling và thực sự tìm hiểu nó!

Và bây giờ chỉ có phiên bản v0.12.2 của nút sẽ được gỡ cài đặt. Hãy nhớ rằng nếu bạn đã cài đặt nhiều phiên bản, thì nút vẫn sẽ có trên hệ thống của bạn, nhưng không phải v0.12.2 (sử dụng ví dụ trên).

Phantom cài đặt

Nếu vì một lý do nào đó, không có phương pháp nào ở trên cho bạn, thì bạn luôn có thể săn lùng thực thi bằng công cụ dòng lệnh

npm install --msvs_version=2012 
9. Lệnh này cho bạn thấy vị trí của tệp cho một lệnh đã cho.

Chúng tôi có thể sử dụng điều này để tìm thấy nơi nút được cài đặt trên hệ thống của bạn. Bạn có thể thử điều này với:

$ which node
/Users/scott/.nvm/versions/node/v4.1.2/bin/node

Bạn có thể thấy trong đầu ra rằng lệnh

//install module (package)
npm install nodemailer		//example of install nodemailer module.

//install with version. Syntax: npm install @
npm install 

//detect version in range
npm install sax@">=0.1.0 <0.2.0"
6 của tôi được liên kết với phiên bản NVM, mặc dù bạn có thể được đặt ở một nơi khác. Bây giờ tôi có thể sử dụng thông tin này để gỡ cài đặt nó.

Sử dụng công cụ này sẽ giúp bạn tìm ra cách thực thi được cài đặt hoặc cách loại bỏ nó bằng tay.