跟着另一个SO,我正在尝试包含尚未推送到npm的最新版本的git repo(LeafletJS)。
packages.config剪切了:
"dependencies": {
"leaflet": "git+https://{git hub generated token}:x-oauth-basic@github.com/Leaflet/Leaflet.git",
然后,
npm install
报告
npm WARN addRemoteGit错误:命令失败:git -c core.longpaths = true config --get remote.origin.url
npm WARN addRemoteGit
npm WARN在ChildProcess.exithandler上添加了AddRemoteGit (child_process.js:206:12)
npm WARN在emitTwo的addRemoteGit(events.js:106:13)
在ChildProcess.emit(events.js:191:7)上的npm WARN addRemoteGit
npm警告在MaybeClose上添加addRemoteGit (内部/ child_process.js:877:16)
npm WARN在Process.ChildProcess._handle.onexit上添加了AddRemoteGit (内部/ child_process.js:226:5)
npm WARN addRemoteGit GIT中+ HTTPS:// {令牌}:x-oauth-basic@github.com/Leaflet/Leaflet.git 重置远程 C:\ Users \用户鲍勃\应用程序数据\漫游\ NPM-cache_git-遥控\ GIT-https- {令牌} -x-OAuth的basic- github-com-Leaflet-Leaflet-git-b27a5a7d因为错误:{错误: 命令失败:git -c core.longpaths = true config --get remote.origin.url
npm WARN addRemoteGit
npm WARN在ChildProcess.exithandler上添加了AddRemoteGit (child_process.js:206:12)
npm WARN在emitTwo的addRemoteGit(events.js:106:13)
在ChildProcess.emit(events.js:191:7)上的npm WARN addRemoteGit
npm警告在MaybeClose上添加addRemoteGit (内部/ child_process.js:877:16)
npm WARN在Process.ChildProcess._handle.onexit上添加了AddRemoteGit (内部/ child_process.js:226:5)
npm WARN addRemoteGit killed:false,
npm WARN addRemoteGit代码:1,
npm WARN addRemoteGit signal:null,
npm WARN addRemoteGit cmd:'git -c core.longpaths = true config --get remote.origin.url'}
答案 0 :(得分:3)
做一个简单的事:
$ npm install --save https://github.com/Leaflet/Leaflet.git
在Leaflet存储库中正确安装最新的主版本(即在撰写本文时为git+https://github.com/Leaflet/Leaflet.git#66cf6a0ea1df84dfcae441e91a9aa3bd66531030
)
话虽如此,不幸的是,从源存储库中提取Leaflet可能不是您需要的最佳选择。实际上,您将无法获得dist
个文件。尝试从node_modules
目录构建它们可能不起作用,因为Leaflet构建过程使用git-rev-sync
,需要在git版本控制的文件夹中运行,这不是你的包的情况。通过npm
...
但您可以在此链接上轻松手动下载当前主版本:
https://leafletjs-cdn.s3.amazonaws.com/content/leaflet/master/leaflet.zip
(传单download page顶部的开发版链接)
您也可以通过CDN使用它们:
<link href="https://leafletjs-cdn.s3.amazonaws.com/content/leaflet/master/leaflet.css" rel="stylesheet" type="text/css" />
<script src="https://leafletjs-cdn.s3.amazonaws.com/content/leaflet/master/leaflet-src.js"></script>
(您不会将其保留用于制作,因为这些文件将继续更改......)