我正在尝试使用npm & bower在我的mac机器上建立一个现有的UI项目。该项目有适当的bower.json和.bowerrc文件。我运行npm install,然后运行bower install。我们的期望是,所有必需的bower包最终都将在.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"
}
}有什么不对的?有用户特权的东西?
发布于 2020-09-04 02:05:42
你的package.json和bower.json里有什么?
与我的另一个项目相比,directory的语法在我看来是正确的。安装后有什么错误吗?
如果您尝试和bower install --verbose,您可能会得到更多的细节。
发布于 2020-09-04 07:14:36
最后解决了这个问题。在我的例子中,卸载brew最新的node 14并通过常规安装程序从头开始安装node 12是有帮助的。
https://stackoverflow.com/questions/63731216
复制相似问题