有什麼東西可以跟踪我安裝的 npm 包並在不同的開發環境中恢復它們嗎?(如“恢復 NuGet 包”) (Is there anything that can keep track of my installed npm packages and restore them on a different dev environment ? (like "Restore NuGet packages"))


問題描述

有什麼東西可以跟踪我安裝的 npm 包並在不同的開發環境中恢復它們嗎?(如“恢復 NuGet 包”) (Is there anything that can keep track of my installed npm packages and restore them on a different dev environment ? (like "Restore NuGet packages"))

所以我是 node/npm 包的新手。這是場景。

  • 我在一個環境中安裝了所有依賴項。
  • 將代碼推送到遠程倉庫
  • 將代碼拉到不同的開發環境。
  • 嘗試自動恢復所有以前安裝的依賴項,但無法想辦法。

我以前使用過 NuGet 包。我期待類似於 “恢復 NuGet 包”的行為。我查看了我的 packages.json 文件,但他們沒有t 列出以後安裝的依賴項,如 packages.config 文件在 NuGet 的情況下會執行。那麼有沒有類似的呢?還是缺少什麼?


參考解法

方法 1:

The package.json file is doing what you are looking for. Installing a dependency with ‑‑save option will add it to the package.json dependency list. On another environment you can install same dependencies with running npm install command.

  1. Install a dependency for the first time: npm install newpackage ‑‑save
  2. Push the package.json to the repo
  3. Pull the repo
  4. Install all dependencies which listed in package.json file by running npm install command in the directory which package.json reside

(by Foez Ahmedsaman.shahmohamadi)

參考文件

  1. Is there anything that can keep track of my installed npm packages and restore them on a different dev environment ? (like "Restore NuGet packages") (CC BY‑SA 2.5/3.0/4.0)

#npm #node.js






相關問題

TFS 構建中的 npm install 拋出“未找到:git” (npm install in TFS build throws "not found: git")

找不到模塊“電子” (Cannot find module 'electron')

使用 npm 進行生成器角度安裝時出現問題 (Trouble during generator-angular installation with npm)

使用 node.js 從谷歌云存儲中刪除多個對象 (Delete multiple objects fron google cloud storage using node.js)

VS Task Runner Explorer - Node Sass 找不到綁定 (VS Task Runner Explorer - Node Sass could not find a binding)

有什麼東西可以跟踪我安裝的 npm 包並在不同的開發環境中恢復它們嗎?(如“恢復 NuGet 包”) (Is there anything that can keep track of my installed npm packages and restore them on a different dev environment ? (like "Restore NuGet packages"))

角度材質工具欄不繼承自角度材質 (Angular material toolbar not inheriting from angular materials)

npm install throws 和錯誤告訴 node 不是一個可識別的命令 (npm install throws and error telling node is not a recognized command)

從代理後面登錄的無服務器框架? (Serverless Framework Login From Behind a Proxy?)

構建工具結構 - NPM、Grunt 和 Wordpress (Build tools structure - NPM, Grunt with Wordpress)

如何解決 Linux 中的“npm ERR!code ELIFECYCLE”錯誤? (How to solve "npm ERR! code ELIFECYCLE" error in Linux?)

如何在 Angular 中導入“數字”:“^1.2.6”? (How to import "numeric": "^1.2.6" in Angular?)







留言討論