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

npm run csr 报错 #77

Closed
bs32g1038 opened this issue Sep 6, 2019 · 5 comments
Closed

npm run csr 报错 #77

bs32g1038 opened this issue Sep 6, 2019 · 5 comments
Assignees

Comments

@bs32g1038
Copy link
Contributor

bs32g1038 commented Sep 6, 2019

问题

[1] start clientRender
[1]
[1] Options:
[1]   --help         Show help                                             [boolean]
[1]   --version, -v                                       [boolean] [default: false]
[1]
[1] TypeError: Property key of ObjectProperty expected node to be of a type ["Identifier","StringLiteral","NumericLiteral"] but
instead got "BooleanLiteral"
[1]     at validate (C:\admin\github.com.project\pangu.admin\node_modules\_@babel_types@7.5.5@@babel\types\lib\definitions\utils.js:131:13)
[1]     at Object.validate (C:\admin\github.com.project\pangu.admin\node_modules\_@babel_types@7.5.5@@babel\types\lib\definitions\core.js:526:11)
[1]     at validateField (C:\admin\github.com.project\pangu.admin\node_modules\_@babel_types@7.5.5@@babel\types\lib\validators\validate.js:22:9)
[1]     at Object.validate (C:\admin\github.com.project\pangu.admin\node_modules\_@babel_types@7.5.5@@babel\types\lib\validators\validate.js:16:3)
[1]     at NodePath._replaceWith (C:\admin\github.com.project\pangu.admin\node_modules\_@babel_traverse@7.5.5@@babel\traverse\lib\path\replacement.js:194:9)
[1]     at NodePath.replaceWith (C:\admin\github.com.project\pangu.admin\node_modules\_@babel_traverse@7.5.5@@babel\traverse\lib\path\replacement.js:178:8)
[1]     at replaceAndEvaluateNode (C:\admin\github.com.project\pangu.admin\node_modules\_babel-plugin-transform-define@1.3.1@babel-plugin-transform-define\lib\index.js:117:12)
[1]     at processNode (C:\Lizhicheng\github.com.project\pangu.admin\node_modules\_babel-plugin-transform-define@1.3.1@babel-plugin-transform-define\lib\index.js:143:5)
[1]     at PluginPass.Identifier (C:\admin\github.com.project\pangu.admin\node_modules\_babel-plugin-transform-define@1.3.1@babel-plugin-transform-define\lib\index.js:23:9)
[1]     at newFn (C:\admin\github.com.project\pangu.admin\node_modules\_@babel_traverse@7.5.5@@babel\traverse\lib\visitors.js:193:21)

系统环境

node:v10.15.3
win10: v1803

版本依赖

  "dependencies": {
    "egg": "^2.23.0",
    "egg-proxy": "^1.1.0",
    "egg-scripts": "^2.11.0",
    "egg-static": "^2.2.0",
    "koa-router": "^7.4.0",
    "react": "16.9.0",
    "react-dev-utils": "^9.0.3",
    "react-dom": "16.9.0",
    "react-router-dom": "^5.0.1",
    "ykfe-utils": "^2.1.1"
 },
"devDependencies": {
    "@babel/core": "^7.5.5",
    "@babel/plugin-transform-runtime": "^7.5.5",
    "@babel/polyfill": "^7.4.4",
    "@babel/preset-env": "^7.5.5",
    "@babel/preset-react": "^7.0.0",
    "@babel/register": "^7.5.5",
    "@babel/runtime": "^7.5.5",
    "babel-loader": "8.0.6",
    "browserslist": "^4.7.0",
    "caniuse-lite": "1.0.30000989",
    "concurrently": "^4.1.2",
    "cross-env": "^5.2.1",
    "css-hot-loader": "^1.4.4",
    "css-loader": "3.2.0",
    "css-modules-require-hook": "^4.2.3",
    "egg-bin": "^4.13.1",
    "file-loader": "4.2.0",
    "less": "^3.10.3",
    "less-loader": "^5.0.0",
    "memory-fs": "^0.4.1",
    "mini-css-extract-plugin": "^0.8.0",
    "nodemon": "^1.19.2",
    "optimize-css-assets-webpack-plugin": "5.0.3",
    "postcss-flexbugs-fixes": "4.1.0",
    "postcss-loader": "3.0.0",
    "postcss-preset-env": "^6.7.0",
    "postcss-safe-parser": "4.0.1",
    "rimraf": "^3.0.0",
    "terser-webpack-plugin": "^2.0.0",
    "url-loader": "2.1.0",
    "webpack": "4.39.3",
    "webpack-bundle-analyzer": "^3.4.1",
    "webpack-cli": "^3.3.8",
    "webpack-dev-server": "3.8.0",
    "webpack-manifest-plugin": "^2.0.4",
    "webpack-merge": "^4.2.2",
    "webpack-node-externals": "^1.7.2",
    "yk-cli": "^2.2.1"
 }

项目来源(官方脚手架)

$ npm install yk-cli -g
$ ykcli init <Your Project Name>
$ cd <Your Project Name>
$ npm i
$ npm start
$ open http://localhost:7001

经过上面步骤尝试 测试 项目,发现命令行报错。后升级依赖包。问题仍然没解决。错误结果一样。

@i5ting
Copy link
Contributor

i5ting commented Sep 6, 2019

@bs32g1038 稍等,win下我们测试一下

@zhangyuang
Copy link
Owner

zhangyuang commented Sep 6, 2019

// webpack.config.client.js
这块加上引号,babel type的一个问题,脚手架可以升级到最新版本已修复
image

@bs32g1038
Copy link
Contributor Author

修改后,可以正常运行了👍

ykcli -version
2.2.1
这个版本生成的脚手架,这个问题没有被修复。希望尽快更新。
这是个非常优秀的项目,不过刚下载下来就报错了,真的吓我一跳。
希望越来越好。

@zhangyuang
Copy link
Owner

修改后,可以正常运行了👍

ykcli -version
2.2.1
这个版本生成的脚手架,这个问题没有被修复。希望尽快更新。
这是个非常优秀的项目,不过刚下载下来就报错了,真的吓我一跳。
希望越来越好。

看了下确实没更新成功,可以扫码加钉钉群一起交流

@zhangyuang
Copy link
Owner

zhangyuang commented Sep 6, 2019

fix by #78 , yk-cli@2.2.3

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