如何通过 NPM 管理非节点模块作为节点项目的依赖项?

How to manage a non-node module as dependency for Node Project thorugh NPM?

我在我的项目中使用 Bower 进行依赖管理。但现在我想转向 node 和 npm。但问题是我的依赖项很少不是像 Smooth-Div-Scroll1 and swiftype-search-jquery2

这样的节点模块

如何在我的节点项目中管理所有这些依赖项。当我尝试做

"swiftype-search-jquery": "git@github.com:swiftype/swiftype-search-jquery.git",
"smooth-div-scroll": "git@github.com:tkahn/Smooth-Div-Scroll.git",

无法下载依赖并抛出错误

npm ERR! code ENOPACKAGEJSON npm ERR! package.json Non-registry package missing package.json: swiftype-search-jquery@git+ssh://git@github.com/swiftype/swiftype-search-jquery.git. npm ERR! package.json npm can't find a package.json file in your current directory.

这些依赖项在它们的文件夹中没有 package.json。

我认为这不可能。 这是从 bower 迁移到 npm 的指南,非常简单。

https://codecraft.tv/courses/angularjs-migration/step-2-typescript-and-webpack/converting-bower-to-npm/

是的,NPM 是不可能的,但与此同时,Yarn 可以在不做任何更改的情况下实现。我们必须使用 "yarn install" 而不是 "npm install" 。

使用 git url 添加 NPM 不存在的依赖项。