[英]How to find node-gyp dependency (..or any dependency) in npm project
我正经历着无法想象的挫败,试图使一个项目总是运行在node-gyp上而无法运行(即通过调用'npm install' )。 我在Windows上,因此我需要安装python和类似Visual Studio的工具。
长话短说...我不想像Visual Studio那样依赖一堆令人讨厌的s ***,所以我想看看这个node-gyp是否可以以某种方式是可选的,或者可以摆脱。
现在,如果我打开package.json文件,我会发现这些依赖关系。
"devDependencies": {
"autoprefixer-stylus": "^0.7.1",
"browser-sync": "^2.8.2",
"gulp": "^3.9.0",
"gulp-cache": "^0.3.0",
"gulp-concat": "^2.6.0",
"gulp-if": "^1.2.5",
"gulp-imagemin": "^2.3.0",
"gulp-minify-html": "^1.0.4",
"gulp-nunjucks-html": "^1.2.2",
"gulp-order": "^1.1.1",
"gulp-plumber": "^1.0.1",
"gulp-stylus": "^2.0.6",
"gulp-uglify": "^1.2.0",
"gulp-util": "^3.0.6",
"jeet": "^6.1.2",
"kouto-swiss": "^0.11.13",
"minimist": "^1.1.3",
"rupture": "^0.6.1"
},
"dependencies": {
"gulp-install": "^0.6.0"
}
我可以通过以下步骤查看每个软件包的依赖关系树:
但是,如果我经历了这些依赖关系中的每一个,我就无法在任何地方看到node-gyp依赖关系。
关于依赖项,我是否不了解? 什么使用node-gyp? 又为什么呢
查找其依赖项
npm ls node-gyp
npm ls
列出了项目中已安装的依赖项。 npm ls node-gyp
将限制node-gyp的子树。
npm-remote-ls
列出了远程软件包的所有依赖项。 您手动检查或使用grep
我创建了findep
,它比两者都快很多(为此目的)。 它可以检查您的本地项目,一个外部npm包,甚至是一个远程github项目,并且具有--greedy
选项,该选项一旦找到指定的依赖项便会停止。
# Checks if current project has a 'node-gyp' dependency
findep node-gyp
# Checks if the npm package 'node-sass' has a 'node-gyp' dependency
findep node-gyp -e node-sass
# Greedily checks if the project 'AngularClass/angular2-webpack-starter' has at least one of these dependencies including "devDependencies":
$ findep he mime lodash ms -GDr -e AngularClass/angular2-webpack-starter
Looking for [he, mime, lodash, ms] in AngularClass/angular2-webpack-starter...
Found 16 dependencies that use [he, mime, lodash, ms]:
assets-webpack-plugin > lodash
string-replace-loader > lodash
karma-coverage > lodash
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.