Module build failed: Error: Plugin/Preset files are not allowed

imdunkind
0
imdunkind
commented 4 months ago

`[email protected]:~/NODEJS/testtest$ npm run dev

[email protected] dev /home/imdunkind/NODEJS/testtest
backpack 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/nodemodules/backpack-core/babel.js at createDescriptor (/home/imdunkind/NODEJS/testtest/nodemodules/@babel/core/lib/config/config-descriptors.js:178:11)
at items.map (/home/imdunkind/NODEJS/testtest/nodemodules/@babel/core/lib/config/config-descriptors.js:109:50) at Array.map (<anonymous>) at createDescriptors (/home/imdunkind/NODEJS/testtest/nodemodules/@babel/core/lib/config/config-descriptors.js:109:29)
at createPresetDescriptors (/home/imdunkind/NODEJS/testtest/nodemodules/@babel/core/lib/config/config-descriptors.js:101:10) at passPerPreset (/home/imdunkind/NODEJS/testtest/nodemodules/@babel/core/lib/config/config-descriptors.js:58:96)
at cachedFunction (/home/imdunkind/NODEJS/testtest/nodemodules/@babel/core/lib/config/caching.js:33:19) at presets.presets (/home/imdunkind/NODEJS/testtest/nodemodules/@babel/core/lib/config/config-descriptors.js:29:84)
at mergeChainOpts (/home/imdunkind/NODEJS/testtest/nodemodules/@babel/core/lib/config/config-chain.js:320:26) at /home/imdunkind/NODEJS/testtest/nodemodules/@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" } }

0
15521054523
0
15521054523
commented 4 days ago

我发现cmty真是脑残,不能解决问题就直说

0
Informations
QuestionUnresolved
#c38 - Created 4 months ago