npm run build 之后npm start,import报错,不支持.如果用npm run generate打包cart 和 detail报错,无法打包typeerror:Cannnot destructrue property ‘name’ of ‘undefinded’ or ‘null’
npm run build 之后用npm run start启动这个报错
import mongoose from 'mongoose'
^^^^^^^^
SyntaxError: Unexpected identifier
at new Script (vm.js:79:7)
at createScript (vm.js:251:10)
at Object.runInThisContext (vm.js:303:10)
at Module._compile (internal/modules/cjs/loader.js:656:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:741:12)
at startup (internal/bootstrap/node.js:285:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! jyg007@1.0.0 start: `cross-env NODE_ENV=production node server/index.js --exec babel-node`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the jyg007@1.0.0 start 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! /Users/jiangyaguang/.npm/_logs/2018-11-14T14_48_22_576Z-debug.log