我正在 Vue 中开发一个应用程序,也使用该x-ray-scraper
库,但是当我尝试npm run serve
在控制台中运行以在本地查看应用程序时,我收到以下错误:
This dependency was not found:
* _http_common in ./node_modules/http-outgoing/index.js
To install it, you can run: npm install --save _http_common
然后我尝试运行该命令npm install --save _http_common
,再次出现错误:
npm ERR! code ETARGET
npm ERR! notarget No matching version found for undefined@_http_common.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
没有x-ray-scraper
库,一切都可以正常启动,但如果我将它包含在我的项目中,则会出现错误。也许错误与版本有关,但我不明白如何修复它。我的package.json
样子:
{
"name": "pc-components",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build"
},
"dependencies": {
"axios": "^0.21.0",
"cheerio": "^1.0.0-rc.3",
"core-js": "^3.6.5",
"dns": "^0.2.2",
"phantom": "^6.3.0",
"selenium-webdriver": "^4.0.0-alpha.8",
"vue": "^2.6.11",
"webpage": "^0.3.0",
"x-ray-scraper": "^3.0.6"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"vue-template-compiler": "^2.6.11"
}
}
谢谢你的帮助。