mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[GH-ISSUE #1969] frp在cnpm中使用遇到的问题,请及时帮忙解决 #1567
Labels
No labels
In Progress
WIP
WaitingForInfo
bug
doc
duplicate
easy
enhancement
future
help wanted
invalid
lifecycle/stale
need-issue-template
need-usage-help
no plan
proposal
pull-request
question
todo
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/frp#1567
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @gongyuan303 on GitHub (Sep 5, 2020).
Original GitHub issue: https://github.com/fatedier/frp/issues/1969
问题仅用于提交错误报告和文档错字。如果文档中存在相同问题或答案,我们将直接将其关闭。
使用以下命令从您的环境中提供关键信息:
如果这是一项功能要求,则不必包括此信息。
您正在使用哪个版本的frp(./ frpc -v或./frps -v)?
正在使用frp_0.31.2,客户端和服务端
您正在使用哪种操作系统和处理器体系结构(go env)?
服务器linux
客户端win10
配置您使用的:
frpc
[cnpm]
type = http
local_ip = 192.168.2.102
local_port = 7001
custom_domains = cnpm.yuming.com
服务端配置nginx转发。如果是http转发到frps的8000,在对应内容地址解析,如果是https转发到443端口
cnpm.yuming.com → cnpm.yuming.com:8000 → frps → frpc → 192.168.2.102:7001上面
原理如上,问题描述如下
重现此问题的步骤:
1.配置cnpm源为: cnpm config set registry http://192.168.2.102:7001 是没问题的,可以下载包,并且192.168.2.102:7001地址浏览器能访问
2.配置cnpm源为: cnpm config set registry http://cnpm.yuming.com 失败,不能下载包,并且 http://cnpm.yuming.com地址浏览器能访问,但是下不了包
3。报错日志显示
ResponseError: Parse Error: Invalid header token, GET http://cnpm.yuming.com/babel-helper-vue-jsx-merge-props -1 (connected: true, keepalive socket: false, agent status: {"createSocketCount":45,"createSocketErrorCount":0,"closeSocketCount":42,"errorSocketCount":0,"timeoutSocketCount":0,"requestCount":0,"freeSockets":{},"sockets":{"cnpm.yuming.com:80:":3},"requests":{}}, socketHandledRequests: 1, socketHandledResponses: 0)
headers: {}
at Socket.socketOnData (_http_client.js:476:22)
at Socket.emit (events.js:311:20)
at addChunk (_stream_readable.js:294:12)
at readableAddChunk (_stream_readable.js:275:11)
at Socket.Readable.push (_stream_readable.js:209:10)
at TCP.onStreamRead (internal/stream_base_commons.js:186:23)
描述您收到的结果:
正常情况应该配置cnpm config set registry http://cnpm.yuming.com,cnpm不能安装包
描述您期望的结果:
正常情况应该配置cnpm config set registry http://cnpm.yuming.com,cnpm命令应该能够安装到包才对
您认为重要的其他信息(例如,问题仅偶尔发生):
您能否指出导致此问题的原因(可选)
### 怀疑cnpm需要其他的配置,frp没有支持****
@Becods commented on GitHub (Sep 5, 2020):
尝试将cnpm.yuming.com强指为192.168.2.102并重试
如无特殊需求还是推荐使用registry.npm.taobao.org