Comments (5)
@k186
你的node版本是多少?
koa2需要node >= v7.6.0,高于这个版本的node是默认支持async语法的
from koa2-cors.
@zadzbw node是6.10.0 目前锁定koa-cors 2.0.4的版本,我没用koa2 用的koa,应该是这个原因
"koa": "2.3.0",
"koa2-cors": "2.0.4",
"koa2-static": "1.0.1"
from koa2-cors.
@k186
koa2就是koa的v2版,从你的package.json来看,你用的就是koa2啊,
你是把你项目的入口文件用babel编译过了?不然6.10.0是跑不起来koa2的啊
from koa2-cors.
@zadzbw 开发环境 是用bable 跑的 然后 发包的时候用 babel转了一次,我现在那个包是要全局跑,所以安全使用就要用node 7.6以上,我后期把这个判断加一下就可以了,目前就用2.0.4的编译过的版本
from koa2-cors.
@k186
恩 可以先使用2.0.4的,等升级到node7.6以后,就能不用babel编译直接使用async语法了
from koa2-cors.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from koa2-cors.