NodeJs request模块运行报错 Error: ./..../tough-cookie/package.json
在安装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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你有多尝试几次吗?模块解析错误有时候是因为网络原因造成的。
================修改====================
刚刚尝试了一下,npm 速度确实慢,不过我试试cnpm 很快就好了,你也可以试试