Gruntjs Yeoman生成的网站中缺少Bower Components文件夹 以下是我运行的所有命令,以防万一: 节点版本:
v0.10.21 安装yo: 这没有产生任何错误或警告 安装generator webapp: 正在创建目录。。。多有用啊 脚手架webapp 以下是我使用的选项:Gruntjs Yeoman生成的网站中缺少Bower Components文件夹 以下是我运行的所有命令,以防万一: 节点版本:,gruntjs,yeoman,bower,yeoman-generator,Gruntjs,Yeoman,Bower,Yeoman Generator,v0.10.21 安装yo: 这没有产生任何错误或警告 安装generator webapp: 正在创建目录。。。多有用啊 脚手架webapp 以下是我使用的选项: Out of the box I include HTML5 Boilerplate and jQuery. [?] What more would you like? [ ] Bootstrap for Sass >[X] RequireJS [ ] Modernizr 现在这确实产生了很多不愉快的信息: - npm
Out of the box I include HTML5 Boilerplate and jQuery.
[?] What more would you like?
[ ] Bootstrap for Sass
>[X] RequireJS
[ ] Modernizr
现在这确实产生了很多不愉快的信息:
- npm WARN package.json wat@0.0.0 No description
npm WARN package.json wat@0.0.0 No repository field.
npm WARN package.json wat@0.0.0 No README data
...
npm http GET https://registry.npmjs.org/grunt-svgmin
npm http GET https://registry.npmjs.org/grunt-concurrent
npmbower ENOGIT git is not installed or not in the PATH
http 304 https://registry.npmjs.org/grunt-contrib-requirejs
npm http 304 https://registry.npmjs.org/grunt
npm http 408 https://registry.npmjs.org/grunt-contrib-imagemin
npm ERR! registry error parsing json
npm http 408 https://registry.npmjs.org/grunt-contrib-watch
npm ERR! registry error parsing json
npm http 304 https://registry.npmjs.org/grunt-bower-requirejs
npm http 304 https://registry.npmjs.org/grunt-contrib-jshint
...
npm http 408 https://registry.npmjs.org/grunt-usemin
npm ERR! registry error parsing json
npm http 408 https://registry.npmjs.org/grunt-contrib-connect
npm ERR! registry error parsing json
...
npm http 304 https://registry.npmjs.org/asn1/0.1.11
npm WARN deprecated object-keys@0.2.0: Please update to the latest object-keys
npm http 304 https://registry.npmjs.org/assert-plus/0.1.2
...
npm WARN prefer global bower@1.2.7 should be installed with -g
正在运行的服务器:
现在问题是:
当浏览器打开时,我有两个404
Failed to load resource: the server responded with a status of 404 (Not Found)
http://127.0.0.1:9000/bower_components/jquery/jquery.js
Failed to load resource: the server responded with a status of 404 (Not Found)
http://127.0.0.1:9000/bower_components/requirejs/require.js
我可以手动创建文件夹并放入文件,但是使用这个脚手架工具有什么意义呢
我错过了什么?我是Yeoman的新手,但问题非常清楚。我已经完成了节点0.10.20和npm 1.3.6的步骤,没有问题 令我惊讶的是,您有
引擎所需的:{“node”:“0.8.x”}
。大多数软件包只需要“>=0.8.0”
。除非您在某个地方有一个定制的package.json,或者文件下载已损坏
您可以查看npm配置文件并在问题中添加package.json的内容(我的在/usr/lib/node_modules/npm linux上)我已经完成了节点0.10.20和npm 1.3.6的步骤,没有问题 令我惊讶的是,您有
引擎所需的:{“node”:“0.8.x”}
。大多数软件包只需要“>=0.8.0”
。除非您在某个地方有一个定制的package.json,或者文件下载已损坏
您可以查看npm配置文件,并在问题中添加package.json的内容(我的在/usr/lib/node\u modules/npm linux上)您需要安装ruby和compass。就在那里
您需要安装ruby和compass。就在那里
非常感谢你抽出时间来看这个问题,我真的很感激。至于答案,我做了同样的步骤4次,也许5次,它仍然给我同样的警告/错误。我将检查package.json。应用程序文件夹中是否有bower components文件夹?通常我会浏览问题以查找与我类似的问题。所以这不是浪费时间:)。鲍尔组件在那里。但是有相同版本的人应该做这个测试谢谢你花时间看这个问题,我真的很感激。至于答案,我做了同样的步骤4次,也许5次,它仍然给我同样的警告/错误。我将检查package.json。应用程序文件夹中是否有bower components文件夹?通常我会浏览问题以查找与我类似的问题。所以这不是浪费时间:)。鲍尔组件在那里。但是有相同版本的人应该做testIs,有没有安装这些的命令?或者我必须以msi或任何其他类型的安装程序的形式下载它们?阅读上面链接的页面-它们有指向不同二进制软件包的链接,或者如果需要,如何从源代码编译。谢谢,我将尝试这些链接,看看会发生什么。@Esteban对您有用吗?我也有同样的问题,但我已经安装了Ruby、Compass和Sass。你使用的是Windows还是Mac?Thanks@pilau我在windows和mac上都试过了,文件夹不在那里。我手动创建了它,并将所需的文件放入其中,这是一个小项目,因此可以通过这种方式完成,但是如果您找到解决方案,请告诉我,谢谢。是否有任何命令可以安装这些文件?或者我必须以msi或任何其他类型的安装程序的形式下载它们?阅读上面链接的页面-它们有指向不同二进制软件包的链接,或者如果需要,如何从源代码编译。谢谢,我将尝试这些链接,看看会发生什么。@Esteban对您有用吗?我也有同样的问题,但我已经安装了Ruby、Compass和Sass。你使用的是Windows还是Mac?Thanks@pilau我在windows和mac上都试过了,文件夹不在那里。我手动创建了它,并将所需的文件放入其中,这是一个小项目,因此可以通过这种方式完成,但如果您找到解决方案,请告诉我,谢谢。
> md wat
> cd wat
wat> yo webapp
Out of the box I include HTML5 Boilerplate and jQuery.
[?] What more would you like?
[ ] Bootstrap for Sass
>[X] RequireJS
[ ] Modernizr
- npm WARN package.json wat@0.0.0 No description
npm WARN package.json wat@0.0.0 No repository field.
npm WARN package.json wat@0.0.0 No README data
...
npm http GET https://registry.npmjs.org/grunt-svgmin
npm http GET https://registry.npmjs.org/grunt-concurrent
npmbower ENOGIT git is not installed or not in the PATH
http 304 https://registry.npmjs.org/grunt-contrib-requirejs
npm http 304 https://registry.npmjs.org/grunt
npm http 408 https://registry.npmjs.org/grunt-contrib-imagemin
npm ERR! registry error parsing json
npm http 408 https://registry.npmjs.org/grunt-contrib-watch
npm ERR! registry error parsing json
npm http 304 https://registry.npmjs.org/grunt-bower-requirejs
npm http 304 https://registry.npmjs.org/grunt-contrib-jshint
...
npm http 408 https://registry.npmjs.org/grunt-usemin
npm ERR! registry error parsing json
npm http 408 https://registry.npmjs.org/grunt-contrib-connect
npm ERR! registry error parsing json
...
npm http 304 https://registry.npmjs.org/asn1/0.1.11
npm WARN deprecated object-keys@0.2.0: Please update to the latest object-keys
npm http 304 https://registry.npmjs.org/assert-plus/0.1.2
...
npm WARN prefer global bower@1.2.7 should be installed with -g
> grunt server
Running "copy:styles" (copy) task
Warning: Running "compass:dist" (compass) task
Warning: You need to have Ruby and Compass installed and in your system PATH for this task to work. More info: https://github.com/gruntjs/grunt-contrib-compass Use --force to continue. Use --force to continue.
> grunt server --force
Warning:
N:\wat\node_modules\grunt-contrib-compass\node_modules\tmp\lib\tmp.js:261
throw err;
^
TypeError: Cannot read property 'stdout' of undefined
at compile (N:\wat\node_modules\grunt-contrib-compass\tasks\compass.js:39:10)
at N:\wat\node_modules\grunt-contrib-compass\tasks\compass.js:70:7
at N:\wat\node_modules\grunt-contrib-compass\tasks\lib\compass.js:121:11
at _fileCreated (N:\wat\node_modules\grunt-contrib-compass\node_modules\
tmp\lib\tmp.js:172:7)
at OpenReq.Req.done (N:\wat\node_modules\grunt-contrib-imagemin\node_mod
ules\gifsicle\node_modules\bin-wrapper\node_modules\download\node_modules\decomp
ress\node_modules\tar\node_modules\fstream\node_modules\graceful-fs\graceful-fs.
js:142:5)
at OpenReq.done (N:\wat\node_modules\grunt-contrib-imagemin\node_modules
\gifsicle\node_modules\bin-wrapper\node_modules\download\node_modules\decompress
\node_modules\tar\node_modules\fstream\node_modules\graceful-fs\graceful-fs.js:6
4:22)
at OpenReq.Req.done (N:\wat\node_modules\grunt-contrib-imagemin\node_mod
ules\gifsicle\node_modules\bin-wrapper\node_modules\download\node_modules\decomp
ress\node_modules\rimraf\node_modules\graceful-fs\graceful-fs.js:142:5)
at OpenReq.done (N:\wat\node_modules\grunt-contrib-imagemin\node_modules
\gifsicle\node_modules\bin-wrapper\node_modules\download\node_modules\decompress
\node_modules\rimraf\node_modules\graceful-fs\graceful-fs.js:64:22)
at OpenReq.Req.done (N:\wat\node_modules\grunt-contrib-imagemin\node_mod
ules\pngquant-bin\node_modules\bin-wrapper\node_modules\download\node_modules\de
compress\node_modules\tar\node_modules\fstream\node_modules\graceful-fs\graceful
-fs.js:142:5)
at OpenReq.done (N:\wat\node_modules\grunt-contrib-imagemin\node_modules
\pngquant-bin\node_modules\bin-wrapper\node_modules\download\node_modules\decomp
ress\node_modules\tar\node_modules\fstream\node_modules\graceful-fs\graceful-fs.
js:64:22) Used --force, continuing.
Running "compass:dist" (compass) task
Warning: You need to have Ruby and Compass installed and in your system PATH for
this task to work. More info: https://github.com/gruntjs/grunt-contrib-compass
Used --force, continuing.
Running "copy:styles" (copy) task
Running "autoprefixer:dist" (autoprefixer) task
File ".tmp/styles/main.css" created.
Running "connect:livereload" (connect) task
Started connect web server on 127.0.0.1:9000.
Running "watch" task
Waiting...
Failed to load resource: the server responded with a status of 404 (Not Found)
http://127.0.0.1:9000/bower_components/jquery/jquery.js
Failed to load resource: the server responded with a status of 404 (Not Found)
http://127.0.0.1:9000/bower_components/requirejs/require.js