【发布时间】:2020-07-24 17:10:26
【问题描述】:
我已经尝试了所有方法,但持续存在的 npm 错误阻止了我进行 npm 安装,请有人知道如何修复和消除这些错误,以便我进行正常的 npm 安装。
21 verbose stack Error: spawn git ENOENT 21 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19) 21 verbose stack at onErrorNT (internal/child_process.js:456:16) 21 verbose stack at processTicksAndRejections (internal/process/task_queues.js:80:21) 22 verbose cwd /srv/daemon-data/c799c1b9-338f-41e8-bd64-35ce6d40e81a 23 verbose Linux 4.15.0-22-generic 24 verbose argv "/root/.nvm/versions/node/v12.14.0/bin/node" "/root/.nvm/versions/node/v12.14.0/bin/npm" "install" 25 verbose node v12.14.0 26 verbose npm v6.13.4 27 error code ENOENT 28 error syscall spawn git 29 error path git 30 error errno ENOENT 31 error enoent Error while executing: 31 error enoent undefined ls-remote -h -t ssh://git@github.com/mklabs/watchd.git 31 error enoent 31 error enoent 31 error enoent spawn git ENOENT 32 error enoent This is related to npm not being able to find a file. 33 verbose exit [ 1, true ]```
任何人都知道如何解决这个问题,因为你们中的一些人问我已经附上了我用于下面 npm 安装的 package.json 希望这有助于找到解决方案
"name": "udb",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"devDependencies": {
"babel-cli": "^6.9.0",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-transform-regenerator": "^6.9.0",
"babel-preset-es2015": "^6.9.0",
"bake-cli": "^0.1.6",
"eslint": "^2.10.2",
"eslint-config-standard": "^5.3.1",
"eslint-plugin-promise": "^1.1.0",
"eslint-plugin-standard": "^1.3.2",
"mocha": "^2.5.2",
"standard-version": "^2.2.1",
"watchd": "github:mklabs/watchd"
},
"bake": {
"description": "Scaffold a basic ES6 setup",
"scripts": {
"start": "echo Starting generation of default template",
"prestart": "echo prestart",
"poststart": "echo poststart",
"install": "npm install --loglevel warn --cache-min Infinity",
"preinstall": "echo Installing dependencies ...",
"postinstall": "npm ls --depth 0"
}
},
"dependencies": {
"better-sqlite3": "^5.4.3",
"config-yml": "^0.10.3",
"console-stamp": "^0.2.9",
"discord.js": "^11.5.1",
"enmap": "^5.2.2",
"ffmpeg": "^0.0.4",
"google": "^2.1.0",
"got": "^9.6.0",
"lodash.sortby": "^4.7.0",
"moment": "^2.24.0",
"moment-duration-format": "^2.3.2",
"mongoose": "^5.7.5",
"ms": "^2.1.2",
"nodemon": "^2.0.2",
"opusscript": "^0.0.7",
"quick.db": "^7.0.0-b22",
"randomstring": "^1.1.5",
"strict-uri-encode": "^2.0.0",
"weather-js": "^2.0.0",
"ytdl-core": "^1.0.0"
},
"author": "",
"license": "ISC"
}
希望有人知道解决方法并可以帮助我解决这个问题。
【问题讨论】:
-
package.json中有什么内容?看起来您依赖于 ssh 上的 git repo,这需要身份验证。 -
better-sqlite3 和其他一些,但这是已知会导致问题的一个
-
那个包是一个文件观察器。也许您的开发部门中有一些东西。在您的项目代码(包括 node_modules)中搜索此字符串:
ssh://git@github.com/mklabs/watchd.git -
没有一个带有该字符串的包都是https
-
你的路径中有 git 吗?
标签: node.js linux git npm node-gyp