【问题标题】:ENOTFOUND Package mkdirp not found or ENOTFOUND Package minimist not foundENOTFOUND 包 mkdirp 未找到或 ENOTFOUND 包 minimist 未找到
【发布时间】:2018-04-21 15:38:35
【问题描述】:

背景:

我使用 gitlab ci 管道在 4 个月前成功编译了带有 bower.json 的 Web 项目,迄今为止没有任何修改(此后代码没有任何变化)。今天,当我重新执行管道时,bower 开始抛出 ENOTFOUND 错误,如本问题后面所述。

各种运行中的错误是ENOTFOUND Package mkdirp not foundENOTFOUND Package minimist not found。考虑到 bower.json 和源代码没有变化,如何纠正或跟踪此错误的来源可能是第 3 方包问题,并且日志文件也没有提到需要哪个第 3 方mkdirp or minimist。因此,这与为什么 bower 从存储库中删除预先存在的包有关。

bower.json sn-p

  "dependencies": {
    "editor.md": "^1.5.0",
    "font-awesome": "^4.7.0",
    "jquery": "^3.2.1",
    "bootstrap": "^3.3.7",
    "lunr.js": "^1.0.0",
    "reveal.js": "^3.4.1",
    "html5shiv": "^3.7.3",
    "maphilight": "^1.3.0",
    "raven-js": "^3.13.1",
    "chart.js": "^2.5.0",
    "moment": "^2.18.1",
    "ga-dev-tools": "git://github.com/googleanalytics/ga-dev-tools.git",
    "userapp": "^2.0.0",
    "threejslib": "threejs#*",
    "threejsex": "git://github.com/stemkoski/stemkoski.github.com.git",
    "mermaid": "^7.0.0",
    "respond": "^1.4.2",
    "REM-unit-polyfill": "^1.3.4",
    "modernizr": "^3.3.1",
    "data-projector": "git://github.com/datacratic/data-projector.git",
    "bootstrap-social": "^5.1.1",
    "d3": "^4.7.4",
    "normalize-css": "^6.0.0",
    "packery": "^2.1.1",
    "masonry": "^4.1.1",
    "isotope": "^3.0.3",
    "gridster": "^0.5.6",
    "jquery.shapeshift": "^2.0.0",
    "shufflejs": "^4.1.1",
    "requirejs": "^2.3.3",
    "github-fork-ribbon-css": "^0.2.1",
    "prefixfree": "*",
    "jquery.balloon.js": "git://github.com/urin/jquery.balloon.js.git#1.0.3",
    "qtip2": "^2.2.1",
    "imagesloaded": "^4.1.1",
    "draggabilly": "^2.1.1",
    "fabric": "^1.7.13"
  },
  "resolutions": {
    "jquery": "^3.2.1",
    "mermaid": "~7.0.0",
    "normalize-css": "~6.0.0",
    "lunr.js": "^1.0.0",
    "gridster": "^0.7.0",
    "prefixfree": "^1.0.10"
  }

错误日志(最后一行)

$ bower install --allow-root

bower ga-dev-tools#*        not-cached git://github.com/googleanalytics/ga-dev-tools.git#*
bower ga-dev-tools#*           resolve git://github.com/googleanalytics/ga-dev-tools.git#*
bower threejsex#*           not-cached git://github.com/stemkoski/stemkoski.github.com.git#*
bower threejsex#*              resolve git://github.com/stemkoski/stemkoski.github.com.git#*
bower data-projector#*      not-cached git://github.com/datacratic/data-projector.git#*
bower data-projector#*         resolve git://github.com/datacratic/data-projector.git#*
bower jquery.balloon.js#1.0.3       not-cached git://github.com/urin/jquery.balloon.js.git#1.0.3
bower jquery.balloon.js#1.0.3          resolve git://github.com/urin/jquery.balloon.js.git#1.0.3
bower jquery#^3.2.1                 not-cached https://github.com/jquery/jquery-dist.git#^3.2.1
bower jquery#^3.2.1                    resolve https://github.com/jquery/jquery-dist.git#^3.2.1
bower lunr.js#^1.0.0                not-cached https://github.com/olivernn/lunr.js.git#^1.0.0
.
.
.
bower threejslib#*                          progress received 95.6MB of 220.2MB downloaded, 43%
bower threejslib#*                          progress received 103.0MB of 220.2MB downloaded, 47%
bower threejslib#*                          progress received 107.1MB of 220.2MB downloaded, 49%
bower threejslib#*                          progress received 111.4MB of 220.2MB downloaded, 51%
bower threejslib#*                          progress received 114.9MB of 220.2MB downloaded, 52%
bower threejslib#*                          progress received 119.2MB of 220.2MB downloaded, 54%
bower threejslib#*                          progress received 123.8MB of 220.2MB downloaded, 56%
bower threejslib#*                          progress received 128.6MB of 220.2MB downloaded, 58%
bower threejslib#*                          progress received 132.7MB of 220.2MB downloaded, 60%
bower threejslib#*                          progress received 138.0MB of 220.2MB downloaded, 63%
bower threejslib#*                          progress received 143.6MB of 220.2MB downloaded, 65%
bower mkdirp#^0.5.1                        ENOTFOUND Package mkdirp not found
ERROR: Job failed: exit code 1

【问题讨论】:

    标签: gitlab bower gitlab-ci


    【解决方案1】:

    放弃很长时间的随机ENOTFOUND Package * not found 错误并显示包名称,即使我不知道或在谷歌中无法搜索,如包ENOTFOUND Package which not found

    后来看到this 文章提到Yarn更好地替代 NPM 和 Bower。因此,我使用 stackoverflow article 将我的项目从 npm/bower 迁移到 yarn 并且错误消失了

    安装yarn后使用的代码是:(它需要以前的bower_components文件夹副本与node_modules一起存在)

    npm install -g bower-away
    bower-away --diff
    bower-away --apply
    rmdir /s /q bower_components
    bower-away
    yarn install
    

    【讨论】:

      猜你喜欢
      • 2014-03-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-13
      • 2018-03-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多