Closed imdunkind closed 5 years ago
This issue as been imported as question since it does not respect koa-template issue template. Only bug reports and feature requests stays open to reduce maintainers workload. If your issue is not a question, please mention the repo admin or moderator to change its type and it will be re-opened automatically. Your question is available at https://cmty.app/nuxt/koa-template/issues/c38.
我发现cmty真是脑残,不能解决问题就直说
`imdunkind@ujosnah:~/NODEJS/testtest$ npm run dev
ERROR Failed to compile with 1 errors 11:06:43
error in ./server/index.js
Module build failed: Error: Plugin/Preset files are not allowed to export objects, only functions. In /home/imdunkind/NODEJS/testtest/node_modules/backpack-core/babel.js at createDescriptor (/home/imdunkind/NODEJS/testtest/node_modules/@babel/core/lib/config/config-descriptors.js:178:11) at items.map (/home/imdunkind/NODEJS/testtest/node_modules/@babel/core/lib/config/config-descriptors.js:109:50) at Array.map ()
at createDescriptors (/home/imdunkind/NODEJS/testtest/node_modules/@babel/core/lib/config/config-descriptors.js:109:29)
at createPresetDescriptors (/home/imdunkind/NODEJS/testtest/node_modules/@babel/core/lib/config/config-descriptors.js:101:10)
at passPerPreset (/home/imdunkind/NODEJS/testtest/node_modules/@babel/core/lib/config/config-descriptors.js:58:96)
at cachedFunction (/home/imdunkind/NODEJS/testtest/node_modules/@babel/core/lib/config/caching.js:33:19)
at presets.presets (/home/imdunkind/NODEJS/testtest/node_modules/@babel/core/lib/config/config-descriptors.js:29:84)
at mergeChainOpts (/home/imdunkind/NODEJS/testtest/node_modules/@babel/core/lib/config/config-chain.js:320:26)
at /home/imdunkind/NODEJS/testtest/node_modules/@babel/core/lib/config/config-chain.js:283:7
internal/modules/cjs/loader.js:605 throw err; ^
Error: Cannot find module '/home/imdunkind/NODEJS/testtest/build/main.js' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:603:15) at Function.Module._load (internal/modules/cjs/loader.js:529:25) at Function.Module.runMain (internal/modules/cjs/loader.js:775:12) at startup (internal/bootstrap/node.js:300:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:826:3)`
package.json
{ "name": "testtest", "version": "1.1.0", "description": "Nuxt.js project", "author": "", "private": true, "scripts": { "dev": "backpack dev", "build": "nuxt build && backpack build", "start": "cross-env NODE_ENV=production node build/main.js", "precommit": "npm run lint", "lint": "eslint --ext .js,.vue --ignore-path .gitignore ." }, "dependencies": { "cross-env": "^5.0.1", "koa": "^2.4.1", "nuxt": "latest", "source-map-support": "^0.4.15" }, "devDependencies": { "babel-eslint": "^7.1.1", "backpack-core": "^0.3.0", "eslint": "^3.13.1", "eslint-loader": "^1.9.0", "eslint-config-standard": "^10.2.1", "eslint-plugin-html": "^2.0.3", "eslint-plugin-import": "^2.2.0", "eslint-plugin-node": "^4.2.2", "eslint-plugin-promise": "^3.4.0", "eslint-plugin-standard": "^3.0.1", "nodemon": "^1.11.0", "scmp": "^2.0.0" } }