Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

23章示例跑不起来 #2

Closed
tabooc opened this issue Dec 4, 2016 · 6 comments
Closed

23章示例跑不起来 #2

tabooc opened this issue Dec 4, 2016 · 6 comments

Comments

@tabooc
Copy link

tabooc commented Dec 4, 2016

运行 npm install 一切正常
npm start 后提示 [webpack-isomorphic-tools] [error] asset not found: ./src/containers/Main/Main.scss

node:v6.3.1
OS:windows 7 64

随后用cnpm install也是正常的,提示 All packages installed...
npm start后问题依旧

详细提示如下:

[webpack-isomorphic-tools] [error] asset not found: ./src/components/Spin/Spin.scss
Hash: 7b971385020909e6641b
Version: webpack 1.13.3
Time: 24660ms
                                  Asset     Size  Chunks             Chunk Names
89889688147bd7575d6327160d64e760.svg   109 kB          [emitted]
f4769f9bdb7466be65088239c12046d1.eot  20.1 kB          [emitted]
448c34a56d699c29117adc64c43affeb.woff2    18 kB          [emitted]
af7ae505a9eed503f8b8e6982036873e.woff2  77.2 kB          [emitted]
fee66e712a8a08eef5805a46892932ad.woff    98 kB          [emitted]
fa2772327f55d8198301fdb8bcfc8158.woff  23.4 kB          [emitted]
e18bbf611f2a2e43afc071aa2f4e1512.ttf  45.4 kB          [emitted]
674f50d287a8c48dc19ba404d20fe713.eot   166 kB          [emitted]
912ec66d7572ff821749319396470bde.svg   444 kB          [emitted]
b06871f281fee6b241d60582ae9369b9.ttf   166 kB          [emitted]
           main-7b971385020909e6641b.js  9.34 MB       0  [emitted]  main
webpack built 7b971385020909e6641b in 24660ms
[webpack-isomorphic-tools] [error] asset not found: ./src/containers/Main/Main.scss
[webpack-isomorphic-tools] [error] asset not found: ./src/components/Spin/Spin.scss

@lewis617
Copy link
Owner

lewis617 commented Dec 4, 2016

我刚才在 Mac、Windows7 和 Linux 上又测试了一遍,没有发现这个问题,你能给我一些其他的细节吗?比如,你的操作系统、Node版本、是否使用yarn或cnpm等。

@lewis617 lewis617 closed this as completed Dec 5, 2016
@ttaccp
Copy link

ttaccp commented Jan 11, 2017

我也是23章跑不起来

npm install 正常
npm start 出问题了

node 6.9.4
window10 64

使用cnpm也出问题

npm install
All packages installed

npm start
./~/.npminstall/css-loader/0.25.0/css-loader!./~/.npminstall/resolve-url-loader/1.6.1/resolve-url-loader!./~/.npminstall/sass-loader/3.2.3/sass-loader?sourceMap!./~/.npminstall/bootstrap-loader/1.3.3/bootstrap-loader/lib/bootstrap.styles.loader.js?{"bootstrapVersion":3,"useCustomIconFontPath":false,"extractStyles":false,"styleLoaders":["style","css","sass"],"styles":["mixins","normalize","print","glyphicons","scaffolding","type","code","grid","tables","forms","buttons","component-animations","dropdowns","button-groups","input-groups","navs","navbar","breadcrumbs","pagination","pager","labels","badges","jumbotron","thumbnails","alerts","progress-bars","media","list-group","panels","wells","responsive-embed","close","modals","tooltip","popovers","carousel","utilities","responsive-utilities"],"scripts":["transition","alert","button","carousel","collapse","dropdown","modal","tooltip","popover","scrollspy","tab","affix"],"configFilePath":"c:/Users/ttaccp/Desktop/production/~/.npminstall/bootstrap-loader/1.3.3/bootstrap-loader/.bootstraprc-3-default","bootstrapPath":"c:/Users/ttaccp/Desktop/production/~/.npminstall/~/bootstrap-sass","bootstrapRelPath":"../~/bootstrap-sass"}!./~/.npminstall/bootstrap-loader/1.3.3/bootstrap-loader/no-op.js [0] Module build failed: [0] module.exports = {};

@lewis617
Copy link
Owner

lewis617 commented Jan 11, 2017

@ttaccp
1,别用cnpm,国外有些开发者的轮子写得不规范,跟cnpm不兼容。使用配置了淘宝源的yarn(极力推荐)或npm。

如何加快yarn下载安装速度?使用yrm

npm i yrm -g
yrm use taobao

2,设置SASS_BINARY_SITE为https://npm.taobao.org/mirrors/node-sass/ ,设置fse_binary_host_mirror 为https://npm.taobao.org/mirrors/fsevents/

//windows
set SASS_BINARY_SITE=https://npm.taobao.org/mirrors/node-sass/
set fse_binary_host_mirror=https://npm.taobao.org/mirrors/fsevents/ 

//linux or mac
export SASS_BINARY_SITE=https://npm.taobao.org/mirrors/node-sass/
export fse_binary_host_mirror= https://npm.taobao.org/mirrors/fsevents/ 

然后再安装npm依赖包,其实一切都是“墙”的问题,如果你完全按照国外的模式在安装npm运行程序,没有任何问题。

@ttaccp
Copy link

ttaccp commented Jan 13, 2017

感谢,已成功运行。

@tabooc
Copy link
Author

tabooc commented Jan 14, 2017

我是全程用代理搞定的。。
有段时间没上了,没及时回复,抱歉。。

@Hlstack
Copy link

Hlstack commented May 20, 2017

使用cnpm没问题,必须全局安装node-gyp

$ sudo cnpm install -g node-gyp
$ npm start  

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants