bower install 不会创建包含软件包的文件夹,即使它是使用 .bowerrc (Mac) 设置的

Posted

技术标签:

【中文标题】bower install 不会创建包含软件包的文件夹,即使它是使用 .bowerrc (Mac) 设置的【英文标题】:bower install does not create folder with packages even though it is set up with .bowerrc (Mac) 【发布时间】:2020-12-23 03:20:09 【问题描述】:

我正在尝试使用 npmbower 在我的 mac 机器上设置现有的 UI 项目。该项目有正确的bower.json.bowerrc 文件。我运行npm install,然后运行bower install。期望所有必要的凉亭包最终将在.bowerrc 指定的目录中创建。 bower install 命令似乎执行没有错误,但没有创建包的文件夹。

.bowerrc 文件内容:


    "directory": "libraries",
    "resolvers": [ "bower-npm-resolver" ]

bower.json 文件内容:


  "name": "ui-project",
  "version": "0.1.0",
  "license": "All rights reserved.",
  "dependencies": 
    "angular": "~1.7.x",
    "angular-mocks": "~1.7.x",
    "angular-translate": "~2.17.x",
    "angular-translate-loader-static-files": "~2.17.x",
    "angular-animate": "~1.7.x",
    "angular-dynamic-locale": "~0.1.x",
    "angular-ui-router": "0.4.2",
    "angular-moment": "~1.1.0",
    "angular-i18n": "~1.7.x",
    "angular-ui-utils": "~0.1.1",
    "angular-messages": "~1.7.x",
    "angular-sanitize": "~1.7.x",
    "angular-uuids": "~0.0.4",
    "angular-cookies": "1.7.x",
    "animate.css": "~3.2.x",
    "restangular": "~1.5.0",
    "ngstorage": "~0.3.x",
    "moment": "~2.10.x",
    "ng-file-upload": "~2.2.x",
    "lodash": "~4.13.1",
    "file-saver": "1.3.3",
    "highcharts-release": "~4.1.x",
    "highcharts-pattern-fill": "https://github.com/highcharts/pattern-fill.git#3.0.2",
    "ng-focus-on": "~0.2.x",
    "ngSmoothScroll": "~2.0.0",
    "Sortable": "https://github.com/RubaXa/Sortable.git#6952f3b525702e0daa9033b06e7e43e3a5c24692",
    "angulartics": "~1.6.0",
    "js-sha256": "~0.3.0",
    "angular-datepicker": "~2.0.3",
    "validator-js": "~8.2.0",
    "ip-address": "~5.8.8",
    "papaparse": "~4.3.7",
    "angulartics-piwik": "~1.0.6",
    "fusion-header": "npm:@muteam/fusion-header#2.1.53-light",
    "single-spa": "npm:single-spa#5.5.3",
    "single-spa-angularjs": "npm:single-spa-angularjs#3.3.0",
    "import-map-overrides": "npm:import-map-overrides#1.15.2",
    "zone.js": "npm:zone.js#0.10.3",
    "systemjs": "npm:systemjs#6.3.2"
  ,
  "resolutions": 
    "angular": "~1.7.x"
  

package.json的内容:


  "name": "ui-project",
  "version": "1.0.2361",
  "copyright": "All rights reserved.",
  "repository": 
    "type": "git",
    "url": "git@stash.muteam.com/ui-project.git"
  ,
  "engines": 
    "node": ">=4.4.0"
  ,
  "scripts": 
    "postinstall": "bower install",
    "postversion": "git add ./bower-lock.json && git commit --amend --no-edit",
    "test": "grunt test",
    "build": "grunt build",
    "grunt": "grunt",
    "grunt:dev": "grunt dev"
  ,
  "devDependencies": 
    "bower": "~1.8.8",
    "bower-npm-resolver": "^0.10.0",
    "chance": "^1.1.4",
    "connect-modrewrite": "^0.10.2",
    "my-custom-common-components": "^0.0.47",
    "grunt": "~0.4.5",
    "grunt-autoprefixer": "~1.0.1",
    "grunt-bower-task": "~0.4.0",
    "grunt-cli": "~1.2.0",
    "grunt-concurrent": "~2.3.0",
    "grunt-contrib-clean": "~1.0.0",
    "grunt-contrib-concat": "~1.0.1",
    "grunt-contrib-connect": "~1.0.2",
    "grunt-contrib-copy": "~1.0.0",
    "grunt-contrib-jshint": "~2.0.0",
    "grunt-contrib-less": "~1.3.0",
    "grunt-contrib-uglify": "~2.0.0",
    "grunt-contrib-watch": "^1.1.0",
    "grunt-exec": "^2.0.0",
    "grunt-git-describe": "~2.3.2",
    "grunt-html2js": "~0.3.6",
    "grunt-jsonlint": "~1.1.0",
    "grunt-karma": "~3.0.2",
    "grunt-less2js": "~0.1.5",
    "grunt-ng-annotate": "^2.0.2",
    "grunt-ng-constant": "~2.0.2",
    "grunt-ngdocs": "~0.2.11",
    "grunt-string-replace": "~1.2.1",
    "grunt-webfont": "~1.4.0",
    "jasmine-core": "~3.5.0",
    "js-beautify": "1.6.14",
    "jshint-path-reporter": "~0.1.3",
    "karma": "~4.4.1",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage": "^1.1.2",
    "karma-firefox-launcher": "~1.0.0",
    "karma-jasmine": "^3.1.1",
    "karma-jasmine-diff-reporter": "^0.6.2",
    "karma-junit-reporter": "~1.1.0",
    "karma-ng-html2js-preprocessor": "~1.0.0",
    "less": "~1.7.3",
    "load-grunt-tasks": "~3.5.0",
    "lodash": "~4.13.1",
    "time-grunt": "~1.4.0"
  ,
  "dependencies": 
    "my-custom-framework": "^1.0.37"
  

可能出了什么问题?具有用户权限的东西?

【问题讨论】:

【参考方案1】:

你的 package.json 和 bower.json 中有什么?

与我的另一个项目相比,directory 的语法在我看来是正确的。安装后是否出现任何错误?

如果您尝试bower install --verbose,您可能会获得更多详细信息

【讨论】:

我已经用 package.json 和 bower.json 的详细信息更新了我的帖子。不幸的是,我无法在此处发布 bower install --verbose 的输出,因为它太长了,但我检查了一下,那里一切正常,没有错误。【参考方案2】:

终于解决了这个问题。就我而言,卸载 brew 的最新版 node 14 并通过常规安装程序从头开始安装 node 12 会有所帮助。

【讨论】:

以上是关于bower install 不会创建包含软件包的文件夹,即使它是使用 .bowerrc (Mac) 设置的的主要内容,如果未能解决你的问题,请参考以下文章

bower命令。

你如何卸载所有的凉亭包?

bower install 是不是需要在与 bower.json 相同的文件夹中运行?

bower install的时候报错

ubuntu使用bower install问题汇总

bower install 给我 EACCES 失败:权限被拒绝错误