我尝试在 Windows 上运行我的 Node 项目, 但是当我想使用命令时:
npm install or npm update
它显示以下错误
我已经删除了node并重新安装了它,但仍然存在同样的问题。
os: windows 10
node version: 8.8.1
npm version: 5.4.2
我的 package.json 文件
{
"name": "mytasklist",
"version": "1.0.0",
"description": "Simple task manager",
"main": "server.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node server.js"
},
"author": "",
"license": "ISC",
"dependencies": {
"binary": "^0.3.0",
"body-parser": "^1.17.2",
"dataformat": "^1.0.0",
"dateformat": "^2.0.0",
"ejs": "^2.5.7",
"express": "^4.15.4",
"fs": "0.0.1-security",
"fs-extra": "^4.0.2",
"html-pdf": "^2.2.0",
"hummus": "^1.0.83",
"js-base64": "^2.3.2",
"js-sha256": "^0.6.0",
"mocha": "^4.0.1",
"mongojs": "^2.4.0",
"mssql": "^4.1.0",
"multer": "^1.3.0",
"node-base64-image": "^1.0.4",
"node-pdftk": "^1.1.1",
"pdfkit": "^0.8.3",
"pdftohtmljs": "^0.4.2",
"phantom-html-to-pdf": "^0.5.5",
"phantomjs": "^2.1.7",
"request": "^2.81.0",
"requests": "^0.2.2",
"sha256": "^0.2.0",
"soap": "^0.21.0",
"tedious": "^2.0.0",
"winston": "^2.3.1",
"winston-daily-rotate-file": "^1.4.6"
}
}
最佳答案
该错误似乎不是来自 npm
而是来自您的依赖项。所以你可以尝试以下方法。
该错误似乎来自依赖项:hummus
。该错误消息表明您的系统中需要有 python
。您可以考虑安装 python,然后重试安装 hummus
模块。以下link也可以给个提示。如果不起作用,您可以考虑从头开始。
从头开始
删除您的package.json
文件。初始化您的项目 npm init
并依次重新安装您的依赖项。然后,您将能够确定哪个依赖项导致安装失败。
关于node.js - hummus 模块导致 npm 安装失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46945752/