一、详细描述 bug
执行命令$npm init @alilc/element your-element-name --registry= https://registry.npmmirror.com
选择rax-单组件后报错:(node:21168) UnhandledPromiseRejectionWarning: ReferenceError: group is not defined
二、如何复现 bug + 详细复现步骤
- $npm init @alilc/element your-element-name --registry= https://registry.npmmirror.com
- 选择 “rax-单组件”
三、问题大概定位
模板代码有一行代码“arguments[0].group”,其中group获取不到
"{\n "name": "<%= projectName %>",\n "version": "0.1.0",\n "description": "",\n "main": "lib/index.js",\n "module": "es/index.js",\n "unpkg": "dist/index.umd.js",\n "typings": "types/index.d.ts",\n "files": [\n "build",\n "dist",\n "lib",\n "es",\n "types"\n ],\n "logo": " https://gw.alicdn.com/imgextra/i2/O1CN01XA2RsI1fjjzUmc2kh_!!6000000004043-2-tps-243-240.png",\n "scripts": {\n "start": "build-scripts start",\n "build": "build-scripts build",\n "lowcode:dev": "build-scripts start --config ./build.lowcode.js",\n "lowcode:build": "build-scripts build --config ./build.lowcode.js",\n "lint": "fie lint",\n "f2elint-scan": "f2elint scan",\n "f2elint-fix": "f2elint fix",\n "prepublishOnly": "npm run build && npm run lowcode:build"\n },\n "repository": {\n "type": "git",\n "url": " git@gitlab.alibaba-inc.com :<%=group%>/<%=project%>.git"\n },\n "keywords": [\n "Rax"\n ],\n "husky": {\n "hooks": {\n "pre-commit": "f2elint commit-file-scan",\n "commit-msg": "f2elint commit-msg-scan"\n }\n },\n "lint-staged": {\n "src//*.(ts|tsx)": [\n "tslint --fix",\n "prettier --write",\n "git add"\n ],\n "docs//.md": [\n "prettier --write",\n "git add"\n ],\n "@(docs|src)/**/.@(js|jsx|ts|tsx)": [\n "eslint --fix",\n "prettier --write",\n "git add"\n ]\n },\n "peerDependencies": {\n "rax": "^1.0.11"\n },\n "devDependencies": {\n "@alib/build-scripts": "^0.1.20",\n "@alifd/build-plugin-lowcode": "^0.3.0",\n "@types/rax": "^1.0.5",\n "build-plugin-component-multiple": "^1.0.0-beta.13",\n "build-plugin-doc-multiple": "^1.0.0-beta.8",\n "eslint-plugin-jsx-plus": "^0.1.0",\n "driver-universal": "^3.1.0",\n "execa": "^2.0.5",\n "expect.js": "^0.3.1",\n "f2elint": "^1.2.0",\n "husky": "^3.0.1",\n "iceworks": "^3.4.5",\n "jest": "^24.8.0",\n "jest-cli": "^24.8.0",\n "lint-staged": "^9.4.2",\n "prettier": "^1.19.1",\n "rax": "^1.0.11",\n "ts-loader": "^6.0.4",\n "ts-mocha": "^8.0.0",\n "ts-node": "^9.1.1",\n "tslint": "^5.18.0",\n "tslint-config-ali": "^0.2.4",\n "tslint-config-prettier": "^1.18.0",\n "tslint-plugin-prettier": "^2.0.1",\n "typescript": "^3.5.3"\n },\n "dependencies": {\n "rax-image": "^2.3.2",\n "rax-text": "^2.1.2",\n "rax-view": "^2.2.0",\n "tslib": "^2.0.1"\n },\n "resolutions": {\n "webpack": "^4.46.x"\n },\n "nyc": {\n "include": "src"\n },\n <% if (!_.isUndefined(arguments[0].group)) { %>\n "publishConfig": {\n "registry": " https://registry.npm.alibaba-inc.com"\n },\n "homepage": " https://mc-fusion.alibaba-inc.com/unpkg/ <%= projectName %>/build/index.html",\n "repository": {\n "type": "git",\n "url": " git@gitlab.alibaba-inc.com :<%=group%>/<%=project%>.git"\n },\n <% } %>\n "componentConfig": {\n "isComponentLibrary": 0\n }\n}\n"
三、环境信息
无需提供
3条答案
按热度按时间8oomwypt1#
你们的技术栈是 rax 技术栈吗~
8oomwypt2#
是的
ioekq8ef3#
这块是由于模板有些问题,已反馈给 @mark-ck