首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Yeoman生成的网站中缺少Bower Components文件夹

Yeoman生成的网站中缺少Bower Components文件夹
EN

Stack Overflow用户
提问于 2013-10-21 15:26:28
回答 2查看 5.7K关注 0票数 0

以下是我运行的所有命令,以防万一:

节点版本:

代码语言:javascript
复制
> node -v

v0.10.21。

安装yo

代码语言:javascript
复制
> npm install -g yo

这不会产生任何错误或警告。

安装生成器-webapp

代码语言:javascript
复制
> npm install -g generator-webapp
npm WARN engine hawk@0.10.2: wanted: {"node":"0.8.x"} (current: {"node":"v0.10.21","npm":"1.3.9"})
npm WARN engine hoek@0.7.6: wanted: {"node":"0.8.x"} (current: {"node":"v0.10.21","npm":"1.3.9"})
npm WARN engine sntp@0.1.4: wanted: {"node":"0.8.x"} (current: {"node":"v0.10.21","npm":"1.3.9"})
npm WARN engine boom@0.3.8: wanted: {"node":"0.8.x"} (current: {"node":"v0.10.21","npm":"1.3.9"})
npm WARN engine cryptiles@0.1.3: wanted: {"node":"0.8.x"} (current: {"node":"v0.10.21","npm":"1.3.9"})

创建目录..。有多有用

代码语言:javascript
复制
> md wat
> cd wat

脚手架网络应用程序

代码语言:javascript
复制
wat> yo webapp

以下是我使用过的选项:

代码语言:javascript
复制
Out of the box I include HTML5 Boilerplate and jQuery.
[?] What more would you like?
 [ ] Bootstrap for Sass
>[X] RequireJS
 [ ] Modernizr

现在,这确实产生了许多不愉快的信息:

代码语言:javascript
复制
- 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

正在运行的服务器:

代码语言:javascript
复制
> 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...

现在问题是:

当浏览器打开的时候我有两个404..。

代码语言:javascript
复制
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

我可以手动创建文件夹并将文件放入其中,但是使用这个脚手架工具的意义是什么。

我遗漏了什么?我是约曼的新手,但约曼的入门页面是非常清晰的。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2013-10-27 04:06:25

你需要安装红宝石和指南针。上面写着就在那儿。

  1. https://www.ruby-lang.org/en/downloads/
  2. http://compass-style.org/install/
票数 4
EN

Stack Overflow用户

发布于 2013-10-24 13:10:10

我已经用节点0.10.20和npm 1.3.6完成了这些步骤,没有问题。

让我惊讶的是你有wanted: {"node":"0.8.x"}作为引擎。大多数包只需要">=0.8.0"。除非您在某个地方有自定义的package.json,或者文件下载已损坏。

您可以查看npm配置文件,并在问题中添加package.json的内容(我的在linux上的/usr/lib/node_node/npm中)

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19498621

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档