Почему мое развертывание npm не удалось? Ошибка [ERR_PACKAGE_PATH_NOT_EXPORTED]: не разрешен основной «экспорт» в ./package.json - PullRequest
2 голосов
/ 08 апреля 2020

Я пытаюсь развернуть не такой маленький проект

npm run deploy

У меня проблемы

Entrypoint main = main.js
[0] ./src/client/index.js 4.29 KiB {0} [built] [failed] [1 error]

ERROR in ./src/client/index.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main resolved in /home/miki/trash-panda-buffet/node_modules/@babel/helper-compilation-targets/package.json
    at applyExports (internal/modules/cjs/loader.js:524:9)

Мои сценарии

 "scripts": {
    "build:dev": "webpack --config ./src/client/webpack.dev.config.js",
    "build:client": "webpack --config ./src/client/webpack.prod.config.js",
    "deploy": "npm run deploy:aws && npm run deploy:client && npm run deploy:data",
    "deploy:aws": "serverless deploy",
    "deploy:client": "npm run build:client && serverless client deploy --no-confirm",
    "deploy:data": "serverless invoke --function populateData",
    "remove": "serverless remove"
  },

Это вывод журнала

9 verbose lifecycle trash-panda-buffet@2.0.0~build:client: CWD: /home/miki/trash-panda-buffet
10 silly lifecycle trash-panda-buffet@2.0.0~build:client: Args: [ '-c', 'webpack --config ./src/client/webpack.prod.config.js' ]
11 silly lifecycle trash-panda-buffet@2.0.0~build:client: Returned: code: 2  signal: null
12 info lifecycle trash-panda-buffet@2.0.0~build:client: Failed to exec build:client script
13 verbose stack Error: trash-panda-buffet@2.0.0 build:client: `webpack --config ./src/client/webpack.prod.config.js`
13 verbose stack Exit status 2
13 verbose stack     at EventEmitter.<anonymous> (/home/miki/.npm/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:315:20)
13 verbose stack     at ChildProcess.<anonymous> (/home/miki/.npm/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:315:20)
13 verbose stack     at maybeClose (internal/child_process.js:1026:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)

Как узнать, почему моя сборка не удалась?

1 Ответ

0 голосов
/ 14 апреля 2020

Решено с

npm run deploy:aws
...