Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/388.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript bower不安装依赖项_Javascript_Build_Frontend_Bower - Fatal编程技术网

Javascript bower不安装依赖项

Javascript bower不安装依赖项,javascript,build,frontend,bower,Javascript,Build,Frontend,Bower,我有以下bower.json { "name": "name of app", "version": "0.0.0", "homepage": "", "license": "MIT", "directory": "public/bower_components", "ignore": [ "**/.*", "node_modules", "bower_components", ], "dependencies": { "less"

我有以下bower.json

{
  "name": "name of app",
  "version": "0.0.0",
  "homepage": "",
  "license": "MIT",
  "directory": "public/bower_components",
  "ignore": [
    "**/.*",
    "node_modules",
    "bower_components",
  ],
  "dependencies": {
    "less": "~1.6.1",
    "bootstrap": "~3.0.3",
    "angular": "~1.2.8",
    "angular-animate": "~1.2.8",
    "angular-route": "~1.2.8"
  }
}
但是当我运行
bowerinstall
时,它不会在public目录下创建
bower\u组件
,也不会安装依赖项。下面是
bower安装
命令的屏幕截图

如何解决此问题

来自文档

可以使用directory属性在.bowerrc文件中设置自定义安装位置。.bowerrc文件应该是项目的bower.json的同级文件。


需要在.bowerrc文件中设置自定义目录路径,而不是在bower.json中设置自定义目录路径

{
  "name": "name of app",
  "version": "0.0.0",
  "homepage": "",
  "license": "MIT",
  "directory": "public/bower_components",
  "ignore": [
    "**/.*",
    "node_modules",
    "bower_components",
  ],
  "dependencies": {
    "less": "~1.6.1",
    "bootstrap": "~3.0.3",
    "angular": "~1.2.8",
    "angular-animate": "~1.2.8",
    "angular-route": "~1.2.8"
  }
}
"bower_components",
删除逗号,它应该会起作用