首页 > 解决方案 > 面临 babel transpile 的问题

问题描述

我已经配置了 babel,但是在运行时我遇到了以下错误

> npx babel node_modules/web-b/src/ -d dist --out-dir node_modules/web-b/src/

node_modules\web-b\src\graphql\mutations\cartValidate\cartvalidate.js -> node_modules\web- 
b\src\graphql\mutations\cartValidate\cartvalidate.js
node_modules\web-b\src\graphql\mutations\cartValidate\cartvalidate.test.js -> node_modules\web- 
b\src\graphql\mutations\cartValidate\cartvalidate.test.js



node_modules/web-b/src/index.js: Unexpected token (18:4)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! web-acc@0.1.0 transpile:buy: `npx babel node_modules/web-b/src/ -d dist --out-dir 
node_modules/web-b/src/`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the web-acc@0.1.0 transpile:buy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\raj\AppData\Roaming\npm-cache\_logs\2020-04-26T05_21_30_237Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! web-acc@0.1.0 transpile:all: `npm run transpile:buy && npm run transpile:common && npm run 
transpile:shop`
npm ERR! Exit status 1

标签: reactjsbabeljs

解决方案


推荐阅读