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

不懂 #1

Closed
ghost opened this issue Mar 9, 2017 · 3 comments
Closed

不懂 #1

ghost opened this issue Mar 9, 2017 · 3 comments

Comments

@ghost
Copy link

ghost commented Mar 9, 2017

看了一下你的源码,一脸懵逼,在我编辑器上都出错了,求指教
deerwar@qq.com

@zhaohaodang
Copy link
Owner

你可以先看看这个 用vue-cli从搭建到发布
Wiki里也列了一些需要学习的东西,罗马不是一日建成的

@txfyteen
Copy link

txfyteen commented Mar 10, 2017

搞了好久终于把博主的build起来了,

  1. npm install 提示我要install canvas

canvas@1.6.4 install /Users/txfyteen/node_modules/canvas
node-gyp rebuild

gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
Package cairo was not found in the pkg-config search path.
Perhaps you should add the directory containing `cairo.pc'
to the PKG_CONFIG_PATH environment variable
No package 'cairo' found

2、提示我又要装cairo先,网络不太好又等了10分钟

txfdeMacBook-Pro:~ txfyteen$ brew install cairo

3、装好后,才npm install canvas

txfdeMacBook-Pro:~ txfyteen$ npm install canvas

canvas@1.6.4 install /Users/txfyteen/node_modules/canvas
node-gyp rebuild

gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
SOLINK_MODULE(target) Release/canvas-postbuild.node
CXX(target) Release/obj.target/canvas/src/Canvas.o
CXX(target) Release/obj.target/canvas/src/CanvasGradient.o
CXX(target) Release/obj.target/canvas/src/CanvasPattern.o
CXX(target) Release/obj.target/canvas/src/CanvasRenderingContext2d.o
CXX(target) Release/obj.target/canvas/src/color.o
CXX(target) Release/obj.target/canvas/src/Image.o
CXX(target) Release/obj.target/canvas/src/ImageData.o
CXX(target) Release/obj.target/canvas/src/init.o
CXX(target) Release/obj.target/canvas/src/FontFace.o
SOLINK_MODULE(target) Release/canvas.node
/Users/txfyteen
└─┬ canvas@1.6.4
└── nan@2.5.1

npm WARN enoent ENOENT: no such file or directory, open '/Users/txfyteen/package.json'
npm WARN txfyteen No description
npm WARN txfyteen No repository field.
npm WARN txfyteen No README data
npm WARN txfyteen No license field.
#虽然提示很多warn,但是这个是装好成功的
``
4、进入到项目的目录
txfdeMacBook-Pro:vue-WeChat-master txfyteen$ npm install

canvas@1.3.16 install /Users/txfyteen/VUE/vue-WeChat-master/node_modules/canvas
node-gyp rebuild

gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
SOLINK_MODULE(target) Release/canvas-postbuild.node
CXX(target) Release/obj.target/canvas/src/Canvas.o
CXX(target) Release/obj.target/canvas/src/CanvasGradient.o
CXX(target) Release/obj.target/canvas/src/CanvasPattern.o
In file included from ../src/CanvasPattern.cc:10:
../src/CanvasPattern.h:23:9: warning: private field '_width' is not used
[-Wunused-private-field]
int _width, _height;
^
../src/CanvasPattern.h:23:17: warning: private field '_height' is not used
[-Wunused-private-field]
int _width, _height;
^
2 warnings generated.
CXX(target) Release/obj.target/canvas/src/CanvasRenderingContext2d.o
CXX(target) Release/obj.target/canvas/src/color.o
CXX(target) Release/obj.target/canvas/src/Image.o
CXX(target) Release/obj.target/canvas/src/ImageData.o
CXX(target) Release/obj.target/canvas/src/init.o
CXX(target) Release/obj.target/canvas/src/FontFace.o
In file included from ../src/FontFace.cc:7:
../src/FontFace.h:27:15: warning: private field '_ftFace' is not used
[-Wunused-private-field]
FT_Face _ftFace;
^
1 warning generated.
SOLINK_MODULE(target) Release/canvas.node
vue-wechat@1.0.0 /Users/txfyteen/VUE/vue-WeChat-master
└─┬ qrcode@0.7.0
└── canvas@1.3.16
接着 npm run dev,终于跑起来了,环境不同也会有很多坑的。感谢博主提供的demo,让我有学习的机会

@zhaohaodang
Copy link
Owner

环境不同也会有很多坑的+1

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

2 participants