Gruntjs Can';我不能让CSS在MacOSX上的Grafana中工作

Gruntjs Can';我不能让CSS在MacOSX上的Grafana中工作,gruntjs,npm,osx-yosemite,grafana,Gruntjs,Npm,Osx Yosemite,Grafana,按照这里的说明,我可以构建Grafana并启动服务器监听,但是CSS显然不起作用。我已尝试重新执行构建前端资产的构建命令,但在以下顺序中遇到错误: npm install npm install -g grunt-cli grunt 不清楚这些命令应该从哪个目录执行。我假设$GOPATH/src/github.com/grafana/grafana,但当我执行第一个命令npm install时,我会遇到一系列错误,如下所示: npm WARN locking Error: EACCES, op

按照这里的说明,我可以构建Grafana并启动服务器监听,但是CSS显然不起作用。我已尝试重新执行构建前端资产的构建命令,但在以下顺序中遇到错误:

npm install
npm install -g grunt-cli
grunt
不清楚这些命令应该从哪个目录执行。我假设$GOPATH/src/github.com/grafana/grafana,但当我执行第一个命令
npm install
时,我会遇到一系列错误,如下所示:

npm WARN locking Error: EACCES, open '/Users/sam/.npm/_locks/glob-386d0e7784ce4d2e.lock'
npm WARN locking     at Error (native)
npm WARN locking  /Users/sam/.npm/_locks/glob-386d0e7784ce4d2e.lock failed { [Error: EACCES, open '/Users/sam/.npm/_locks/glob-386d0e7784ce4d2e.lock']
npm WARN locking   errno: -13,
npm WARN locking   code: 'EACCES',
npm WARN locking   path: '/Users/sam/.npm/_locks/glob-386d0e7784ce4d2e.lock' }
npm ERR! Darwin 14.0.0
npm ERR! argv "node" "/usr/local/bin/npm" "install"
npm ERR! node v0.12.7
npm ERR! npm  v2.11.3

npm ERR! Attempt to unlock /Users/sam/Projects/go/src/github.com/grafana/grafana/node_modules/glob, which hasn't been locked
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
最后,当我执行
grunt
时,我得到以下致命错误:

grunt-cli: The grunt command line interface. (v0.1.13)

Fatal error: Unable to find local grunt.

If you're seeing this message, either a Gruntfile wasn't found or grunt
hasn't been installed locally to your project. For more information about
installing and configuring grunt, please see the Getting Started guide:

http://gruntjs.com/getting-started
我还验证了我在项目目录中有package.json和Gruntfile.js文件。以下是所有文件的列表(如果有帮助):

09:25:54|~/Projects/go/src/github.com/grafana/grafana$ ls -alF
total 47648
drwxr-xr-x  42 sam  staff      1428 Sep  5 21:21 ./
drwxr-xr-x   3 sam  staff       102 Sep  5 17:59 ../
-rw-r--r--   1 sam  staff        36 Sep  5 18:02 .bowerrc
-rw-r--r--   1 sam  staff       344 Sep  5 18:02 .bra.toml
-rw-r--r--   1 sam  staff       197 Sep  5 18:02 .editorconfig
drwxr-xr-x  13 sam  staff       442 Sep  5 19:28 .git/
-rw-r--r--   1 sam  staff       345 Sep  5 18:02 .gitignore
drwxr-xr-x   3 sam  staff       102 Sep  5 18:02 .hooks/
-rw-r--r--   1 sam  staff       418 Sep  5 18:02 .jscs.json
-rw-r--r--   1 sam  staff       287 Sep  5 18:02 .jsfmtrc
-rw-r--r--   1 sam  staff       564 Sep  5 18:02 .jshintrc
-rw-r--r--   1 sam  staff     54566 Sep  5 18:02 CHANGELOG.md
-rw-r--r--   1 sam  staff       571 Sep  5 18:02 CONTRIBUTING.md
drwxr-xr-x   5 sam  staff       170 Sep  5 18:02 Godeps/
-rw-r--r--@  1 sam  staff      1289 Sep  5 18:02 Gruntfile.js
-rw-r--r--   1 sam  staff       578 Sep  5 18:02 LICENSE.md
-rw-r--r--   1 sam  staff       638 Sep  5 18:02 NOTICE.md
-rw-r--r--   1 sam  staff      5286 Sep  5 18:02 README.md
-rw-r--r--   1 sam  staff       591 Sep  5 18:02 appveyor.yml
drwxr-xr-x   3 sam  staff       102 Sep  5 18:02 benchmarks/
drwxr-xr-x   4 sam  staff       136 Sep  5 19:28 bin/
-rw-r--r--   1 sam  staff       569 Sep  5 18:02 bower.json
-rw-r--r--   1 sam  staff     11721 Sep  5 18:02 build.go
-rw-r--r--   1 sam  staff       637 Sep  5 18:02 circle.yml
drwxr-xr-x   5 sam  staff       170 Sep  5 18:02 conf/
drwxr-xr-x   5 sam  staff       170 Sep  5 18:50 data/
drwxr-xr-x   8 sam  staff       272 Sep  5 18:02 docker/
drwxr-xr-x   9 sam  staff       306 Sep  5 18:02 docs/
drwxr-xr-x   8 sam  staff       272 Sep  5 18:02 emails/
-rw-r--r--@  1 sam  staff     35472 Sep  5 19:46 err.txt
-rwxr-xr-x   1 sam  staff  24195460 Sep  5 18:49 grafana*
-rw-r--r--   1 sam  staff        24 Sep  5 18:02 latest.json
-rw-r--r--   1 sam  staff      2857 Sep  5 18:02 main.go
-rw-r--r--   1 sam  staff      6693 Sep  5 21:21 npm-debug.log
-rw-r--r--@  1 sam  staff      1870 Sep  5 18:02 package.json
drwxr-xr-x   4 sam  staff       136 Sep  5 18:02 packaging/
drwxr-xr-x  17 sam  staff       578 Sep  5 18:02 pkg/
drwxr-xr-x  12 sam  staff       408 Sep  5 18:02 public/
drwxr-xr-x   7 sam  staff       238 Sep  5 18:02 tasks/
-rwxr-xr-x   1 sam  staff      1178 Sep  5 18:02 test.sh*
drwxr-xr-x   3 sam  staff       102 Sep  5 18:02 tests/
drwxr-xr-x   3 sam  staff       102 Sep  5 18:02 vendor/
当我使用
/bin/grafana server
(来自$GOPATH/src/github.com/grafana/grafana)启动服务器时,我得到了预期的输出,但随后导航到,最后一行添加了404错误,如下所示:

npm WARN locking Error: EACCES, open '/Users/sam/.npm/_locks/grunt-cli-58f484dab06f0a30.lock'
npm WARN locking     at Error (native)
npm WARN locking  /Users/sam/.npm/_locks/grunt-cli-58f484dab06f0a30.lock failed { [Error: EACCES, open '/Users/sam/.npm/_locks/grunt-cli-58f484dab06f0a30.lock']
npm WARN locking   errno: -13,
npm WARN locking   code: 'EACCES',
npm WARN locking   path: '/Users/sam/.npm/_locks/grunt-cli-58f484dab06f0a30.lock' }
npm ERR! Darwin 14.0.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "grunt-cli"
npm ERR! node v0.12.7
npm ERR! npm  v2.11.3

npm ERR! Attempt to unlock /usr/local/lib/node_modules/grunt-cli, which hasn't been locked
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/sam/Projects/go/src/github.com/grafana/grafana/npm-debug.log
09:27:13|~/Projects/go/src/github.com/grafana/grafana$ ./bin/grafana-server 
2015/09/05 21:34:22 [I] Starting Grafana
2015/09/05 21:34:22 [I] Version: 2.2.0-pre1, Commit: v2.1.2+199-gf27f028, Build date: 2015-09-04 08:34:01 -0700 MST
2015/09/05 21:34:22 [I] Configuration Info
Config files:
  [0]: /Users/sam/Projects/go/src/github.com/grafana/grafana/conf/defaults.ini
Paths:
  home: /Users/sam/Projects/go/src/github.com/grafana/grafana
  data: /Users/sam/Projects/go/src/github.com/grafana/grafana/data
  logs: /Users/sam/Projects/go/src/github.com/grafana/grafana/data/log

2015/09/05 21:34:22 [I] Database: sqlite3
2015/09/05 21:34:22 [I] Migrator: Starting DB migration
2015/09/05 21:34:22 [I] Listen: http://0.0.0.0:3000
2015/09/05 21:36:33 [I] Completed /css/grafana.dark.min.css 404 Not Found in 1.799267ms
以下是包含在项目中的Gruntfile.js的内容(即我没有编写它):

此外,由于需要它,下面是项目中所有CSS文件的列表(尽管我不确定这些是否是UI使用的CSS文件):


有人对如何让CSS正常工作有什么建议吗?我想我遗漏了一些明显的东西,但我已经做了几个小时了,找不到任何有用的东西。谢谢

导入css时可能缺少路径

可能只需在路径中添加“public/vendor”即可解决此问题

关于grunt文件,节点似乎正在另一个文件夹中加载任务:

 loadConfig(config,'./tasks/options/');      

 so I think you should update the question or look up the tasks at this line
您可以看到grunt的文件示例


看看grunt对默认任务(例如:$grunt)做了什么。

导入css时,您可能缺少路径

可能只需在路径中添加“public/vendor”即可解决此问题

关于grunt文件,节点似乎正在另一个文件夹中加载任务:

 loadConfig(config,'./tasks/options/');      

 so I think you should update the question or look up the tasks at this line
您可以看到grunt的文件示例


看看grunt对默认任务(例如:$grunt)做了什么

您能显示您正在运行的gruntfile吗?关于css,您可能没有正确设置src路径。你能告诉我这个css在项目中的位置吗?我已经更新了这个问题,将Gruntfile.js的内容包括在内。我不确定CSS在哪里,因为这不是我的项目(现在搜索)。只是在项目中添加了CSS文件列表。请让我知道,如果任何其他支持信息将是有益的。谢谢你能显示你正在运行的Grunfile吗?关于css,您可能没有正确设置src路径。你能告诉我这个css在项目中的位置吗?我已经更新了这个问题,将Gruntfile.js的内容包括在内。我不确定CSS在哪里,因为这不是我的项目(现在搜索)。只是在项目中添加了CSS文件列表。请让我知道,如果任何其他支持信息将是有益的。谢谢我不确定Grafana的CSS路径在哪里。我希望它能被正确配置,这样我所需要做的就是下载和构建。我怀疑我在构建过程中做错了什么,或者构建说明不完整。我希望在MacOSX上构建Grafana的人能指出我的错误。我不确定Grafana的CSS路径在哪里。我希望它能被正确配置,这样我所需要做的就是下载和构建。我怀疑我在构建过程中做错了什么,或者构建说明不完整。我希望在MacOSX上构建Grafana的人能指出我的错误。
 loadConfig(config,'./tasks/options/');      

 so I think you should update the question or look up the tasks at this line