NodeJs request模块运行报错 Error: ./..../tough-cookie/package.json

发布于 2022-09-02 11:23:32 字数 7006 浏览 9 评论 0

在安装nodeJS request模块运行中报错,各位大侠给小弟看看什么问题:

stream.js:74
      throw er; // Unhandled stream error in pipe.
      ^
Error: ./~/request/~/tough-cookie/package.json
Module parse failed: /Users/DongYao/Develop/proj-1/weicang_c/node_modules/request/node_modules/tough-cookie/package.json Line 2: Unexpected token :
You may need an appropriate loader to handle this file type.
| {
|   "author": {
|     "name": "Jeremy Stashewsky",
|     "email": "jstashewsky@salesforce.com"
 @ ./~/request/~/tough-cookie/lib/cookie.js 38:14-40./~/request/~/mime-types/~/mime-db/db.json
Module parse failed: /Users/DongYao/Develop/proj-1/weicang_c/node_modules/request/node_modules/mime-types/node_modules/mime-db/db.json Line 2: Unexpected token :
You may need an appropriate loader to handle this file type.
| {
|   "application/1d-interleaved-parityfec": {
|     "source": "iana"
|   },
 @ ./~/request/~/mime-types/~/mime-db/index.js 11:17-37./~/request/~/har-validator/lib/schemas/cache.json
Module parse failed: /Users/DongYao/Develop/proj-1/weicang_c/node_modules/request/node_modules/har-validator/lib/schemas/cache.json Line 2: Unexpected token :
You may need an appropriate loader to handle this file type.
| {
|   "properties": {
|     "beforeRequest": {
|       "$ref": "#cacheEntry"
 @ ./~/request/~/har-validator/lib/schemas/index.js 4:9-32./~/request/~/har-validator/lib/schemas/cacheEntry.json
Module parse failed: /Users/DongYao/Develop/proj-1/weicang_c/node_modules/request/node_modules/har-validator/lib/schemas/cacheEntry.json Line 2: Unexpected token :
You may need an appropriate loader to handle this file type.
| {
|   "oneOf": [{
|     "type": "object",
|     "optional": true,
 @ ./~/request/~/har-validator/lib/schemas/index.js 5:14-42./~/request/~/har-validator/lib/schemas/content.json
Module parse failed: /Users/DongYao/Develop/proj-1/weicang_c/node_modules/request/node_modules/har-validator/lib/schemas/content.json Line 2: Unexpected token :
You may need an appropriate loader to handle this file type.
| {
|   "type": "object",
|   "required": [
|     "size",
 @ ./~/request/~/har-validator/lib/schemas/index.js 6:11-36./~/request/~/har-validator/lib/schemas/cookie.json
Module parse failed: /Users/DongYao/Develop/proj-1/weicang_c/node_modules/request/node_modules/har-validator/lib/schemas/cookie.json Line 2: Unexpected token :
You may need an appropriate loader to handle this file type.
| {
|   "type": "object",
|   "required": [
|     "name",
 @ ./~/request/~/har-validator/lib/schemas/index.js 7:10-34./~/request/~/har-validator/lib/schemas/creator.json
Module parse failed: /Users/DongYao/Develop/proj-1/weicang_c/node_modules/request/node_modules/har-validator/lib/schemas/creator.json Line 2: Unexpected token :
You may need an appropriate loader to handle this file type.
| {
|   "type": "object",
|   "required": [
|     "name",
 @ ./~/request/~/har-validator/lib/schemas/index.js 8:11-36./~/request/~/har-validator/lib/schemas/entry.json
Module parse failed: /Users/DongYao/Develop/proj-1/weicang_c/node_modules/request/node_modules/har-validator/lib/schemas/entry.json Line 2: Unexpected token :
You may need an appropriate loader to handle this file type.
| {
|   "type": "object",
|   "optional": true,
|   "required": [
 @ ./~/request/~/har-validator/lib/schemas/index.js 9:9-32./~/request/~/har-validator/lib/schemas/har.json
Module parse failed: /Users/DongYao/Develop/proj-1/weicang_c/node_modules/request/node_modules/har-validator/lib/schemas/har.json Line 2: Unexpected token :
You may need an appropriate loader to handle this file type.
| {
|   "type": "object",
|   "required": [
|     "log"
 @ ./~/request/~/har-validator/lib/schemas/index.js 10:7-28./~/request/~/har-validator/lib/schemas/log.json
Module parse failed: /Users/DongYao/Develop/proj-1/weicang_c/node_modules/request/node_modules/har-validator/lib/schemas/log.json Line 2: Unexpected token :
You may need an appropriate loader to handle this file type.
| {
|   "type": "object",
|   "required": [
|     "version",
 @ ./~/request/~/har-validator/lib/schemas/index.js 11:7-28./~/request/~/har-validator/lib/schemas/page.json
Module parse failed: /Users/DongYao/Develop/proj-1/weicang_c/node_modules/request/node_modules/har-validator/lib/schemas/page.json Line 2: Unexpected token :
You may need an appropriate loader to handle this file type.
| {
|   "type": "object",
|   "optional": true,
|   "required": [
 @ ./~/request/~/har-validator/lib/schemas/index.js 12:8-30./~/request/~/har-validator/lib/schemas/pageTimings.json
Module parse failed: /Users/DongYao/Develop/proj-1/weicang_c/node_modules/request/node_modules/har-validator/lib/schemas/pageTimings.json Line 2: Unexpected token :
You may need an appropriate loader to handle this file type.
| {
|   "type": "object",
|   "properties": {
|     "onContentLoad": {
 @ ./~/request/~/har-validator/lib/schemas/index.js 13:15-44./~/request/~/har-validator/lib/schemas/postData.json
Module parse failed: /Users/DongYao/Develop/proj-1/weicang_c/node_modules/request/node_modules/har-validator/lib/schemas/postData.json Line 2: Unexpected token :
You may need an appropriate loader to handle this file type.
| {
|   "type": "object",
|   "optional": true,
|   "required": [
 @ ./~/request/~/har-validator/lib/schemas/index.js 14:12-38./~/request/~/har-validator/lib/schemas/record.json
Module parse failed: /Users/DongYao/Develop/proj-1/weicang_c/node_modules/request/node_modules/har-validator/lib/schemas/record.json Line 2: Unexpected token :
You may need an appropriate loader to handle this file type.
| {
|   "type": "object",
|   "required": [
|     "name",
 @ ./~/request/~/har-validator/lib/schemas/index.js 15:10-34./~/request/~/har-validator/lib/schemas/request.json
Module parse failed: /Users/DongYao/Develop/proj-1/weicang_c/node_modules/request/node_modules/har-validator/lib/schemas/request.json Line 2: Unexpected token :
You may need an appropriate loader to handle this file type.
| {
|   "type": "object",
|   "required": [
|     "method",
 @ ./~/request/~/har-validator/lib/schemas/index.js 16:11-36./~/request/~/har-validator/lib/schemas/response.json
Module parse failed: /Users/DongYao/Develop/proj-1/weicang_c/node_modules/request/node_modules/har-validator/lib/schemas/response.json Line 2: Unexpected token :
You may need an appropriate loader to handle this file type.
| {
|   "type": "object",
|   "required": [
|     "status",
 @ ./~/request/~/har-validator/lib/schemas/index.js 17:12-38./~/request/~/har-validator/lib/schemas/timings.json
Module parse failed: /Users/DongYao/Develop/proj-1/weicang_c/node_modules/request/node_modules/har-validator/lib/schemas/timings.json Line 2: Unexpected token :
You may need an appropriate loader to handle this file type.
| {
|   "required": [
|     "send",
|     "wait",
 @ ./~/request/~/har-validator/lib/schemas/index.js 18:11-36

图片描述

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

凉宸 2022-09-09 11:23:32

你有多尝试几次吗?模块解析错误有时候是因为网络原因造成的。

================修改====================

刚刚尝试了一下,npm 速度确实慢,不过我试试cnpm 很快就好了,你也可以试试

图片描述

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文