Closed zj-baozi closed 5 years ago
babel7跟babel6不兼容导致的。你需要升级到babel7
升级完babel7还是报babel-plugin-transform-object-rest-spread,已重新安装了该插件
@alipay/bank-mobile@2.0.0 start /Users/prj/bank-mobile
cross-env NODE_ENV=development concurrently "cross-env DEMO_ENV=react bisheng start -c ./site/bisheng.desktop.config.js" "cross-env DEMO_ENV=preact bisheng start -c ./site/bisheng.kitchen.config.js"
[1] module.js:549
[1] throw err;
[1] ^
[1]
[1] Error: Cannot find module 'babel-plugin-transform-object-rest-spread'
[1] at Function.Module._resolveFilename (module.js:547:15)
[1] at Function.resolve (internal/module.js:18:19)
[1] at Object.
"devDependencies": { "@babel/core": "^7.0.0", "@babel/plugin-proposal-class-properties": "^7.2.3", "@babel/plugin-proposal-object-rest-spread": "^7.2.0", "@babel/plugin-transform-runtime": "^7.0.0", "@babel/preset-env": "^7.0.0", "@babel/runtime": "^7.0.0", "@types/prop-types": "^15.5.6", "@types/react": "^16.4.15", "@types/react-dom": "^16.0.8", "antd": "latest", "antd-mobile": "^2.2.6", "antd-mobile-demo-data": "^0.2.0", "antd-tools": "^6.4.4", "babel-core": "^7.0.0-bridge.0", "babel-eslint": "^10.0.1", "babel-jest": "^23.4.2", "babel-plugin-import": "^1.6.2", "babel-plugin-transform-class-properties": "^6.24.1", "bisheng": "^1.0.1", "bisheng-plugin-antd": "^0.17.0", "bisheng-plugin-description": "^0.1.4", "bisheng-plugin-react": "^1.0.0", "bisheng-plugin-toc": "^0.4.4", "concurrently": "^3.4.0", "cross-env": "^5.0.1", "css-split-webpack-plugin": "^0.2.5", "dora-plugin-upload": "^0.3.1", "enquire.js": "^2.1.1", "enzyme": "^3.0.0", "enzyme-adapter-react-16": "^1.0.0", "enzyme-to-json": "^3.0.0", "eslint": "^5.6.1", "eslint-config-airbnb": "^17.1.0", "eslint-plugin-babel": "^5.3.0", "eslint-plugin-import": "^2.14.0", "eslint-plugin-jsx-a11y": "^6.1.2", "eslint-plugin-markdown": "~1.0.0-beta.6", "eslint-plugin-react": "^7.11.1", "eslint-tinker": "~0.4.1", "glob": "^7.1.1", "gulp": "^3.9.1", "jest": "^23.0.0", "jest-spec-reporter": "^1.0.3", "jsonml.js": "^0.1.0", "lesshint": "^4.0.2", "lint-staged": "^7.0.0", "lodash.debounce": "^4.0.6", "mockdate": "^2.0.1", "pre-commit": "1.x", "preact": "^8.3.1", "preact-compat": "^3.18.4", "prompt": "^1.0.0", "qrcode.react": "^0.7.1", "raf": "^3.4.0", "rc-form": "1.x", "react": "^16.0.0", "react-copy-to-clipboard": "^5.0.0", "react-document-title": "^2.0.1", "react-dom": "^16.0.0", "react-github-button": "^0.1.9", "react-intl": "^2.2.3", "react-sticky": "^6.0.1", "stylelint": "^8.0.0", "stylelint-config-standard": "^17.0.0", "typescript": "~2.9.1", "walk-sync": "^0.3.3", "webpack-visualizer-plugin": "^0.1.11" },
babel7升级,相应的plugin, preset也要升级。请查阅babel7官方的升级指南。
Compiling 🚚 Bisheng webpackbar 11:23:46 [1] ℹ Compiling 🚚 Bisheng webpackbar 11:23:46 [0] (node:83465) DeprecationWarning: Tapable.plugin is deprecated. Use new API on
.hooks
instead [1] (node:83466) DeprecationWarning: Tapable.plugin is deprecated. Use new API on.hooks
instead [1] Trace: The node type SpreadProperty has been renamed to SpreadElement [1] at Object.isSpreadProperty (/Users/prj/bank-mobile/node_modules/@babel/types/lib/validators/generated/index.js:4256:11) [1] at hasSpread (/Users/prj/bank-mobile/node_modules/babel-plugin-transform-object-rest-spread/lib/index.js:38:13) [1] at PluginPass.ObjectExpression (/Users/prj/bank-mobile/node_modules/babel-plugin-transform-object-rest-spread/lib/index.js:234:14) [1] at newFn (/Users/prj/bank-mobile/node_modules/@babel/traverse/lib/visitors.js:193:21) [1] at NodePath._call (/Users/prj/bank-mobile/node_modules/@babel/traverse/lib/path/context.js:53:20) [1] at NodePath.call (/Users/prj/bank-mobile/node_modules/@babel/traverse/lib/path/context.js:40:17) [1] at NodePath.visit (/Users/prj/bank-mobile/node_modules/@babel/traverse/lib/path/context.js:88:12) [1] at TraversalContext.visitQueue (/Users/prj/bank-mobile/node_modules/@babel/traverse/lib/context.js:118:16) [1] at TraversalContext.visitMultiple (/Users/prj/bank-mobile/node_modules/@babel/traverse/lib/context.js:85:17) [1] at TraversalContext.visit (/Users/prj/bank-mobile/node_modules/@babel/traverse/lib/context.js:144:19) [1] Trace: The node type SpreadProperty has been renamed to SpreadElement [1] at Object.isSpreadProperty (/Users/prj/bank-mobile/node_modules/@babel/types/lib/validators/generated/index.js:4256:11) [1] at hasSpread (/Users/prj/bank-mobile/node_modules/babel-plugin-transform-object-rest-spread/lib/index.js:38:13) [1] at PluginPass.ObjectExpression (/Users/prj/bank-mobile/node_modules/babel-plugin-transform-object-rest-spread/lib/index.js:234:14) [1] at newFn (/Users/prj/bank-mobile/node_modules/@babel/traverse/lib/visitors.js:193:21) [1] at NodePath._call (/Users/prj/bank-mobile/node_modules/@babel/traverse/lib/path/context.js:53:20) [1] at NodePath.call (/Users/prj/bank-mobile/node_modules/@babel/traverse/lib/path/context.js:40:17) [1] at NodePath.visit (/Users/prj/bank-mobile/node_modules/@babel/traverse/lib/path/context.js:88:12) [1] at TraversalContext.visitQueue (/Users/prj/bank-mobile/node_modules/@babel/traverse/lib/context.js:118:16) [1] at TraversalContext.visitMultiple (/Users/prj/bank-mobile/node_modules/@babel/traverse/lib/context.js:85:17) [1] at TraversalContext.visit (/Users/prj/bank-mobile/node_modules/@babel/traverse/lib/context.js:144:19) [1] Trace: The node type SpreadProperty has been renamed to SpreadElement