Обращение к `Не удается найти модуль '@ babel / plugin-transform-реагировать-jsx'` во время сборки - PullRequest
0 голосов
/ 04 ноября 2018

Я сталкиваюсь со следующей ошибкой при создании моего (ранее работавшего) приложения с конвейером bitbucket:

...

[4/4] Building fresh packages...
success Saved lockfile.
success Saved 1 new dependency.
└─ babel-core@6.26.3
Done in 22.08s.
?  /opt/atlassian/pipelines/agent/build/src/index.js: Cannot find module '@babel/plugin-transform-react-jsx'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at require (/opt/atlassian/pipelines/agent/build/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
    at /opt/atlassian/pipelines/agent/build/node_modules/parcel-bundler/lib/transforms/babel/jsx.js:51:22
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (/opt/atlassian/pipelines/agent/build/node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
    at _next (/opt/atlassian/pipelines/agent/build/node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)
npm info lifecycle parcel-react@1.0.0~build: Failed to exec build script
npm ERR! Linux 4.14.63-coreos
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build"
npm ERR! node v7.10.1
npm ERR! npm  v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! parcel-react@1.0.0 build: `parcel build index.html --public-url ./`
npm ERR! Exit status 1
...

Мои package.json строки, связанные со сценариями и зависимостями, выглядят так:

  "scripts": {
    "start": "parcel index.html",
    "build": "parcel build index.html --public-url ./",
    "deploy": "firebase deploy --token $FIREBASE_TOKEN"
  },
  ...
  "dependencies": {
    "axios": "^0.18.0",
    "babel-plugin-transform-class-properties": "^6.24.1",
    "babel-plugin-transform-object-rest-spread": "^6.26.0",
    "classnames": "^2.2.6",
    "firebase": "^5.5.7",
    "immutable": "^3.8.2",
    "lodash": "^4.17.10",
    "mark-twain": "^2.0.3",
    "node-sass": "^4.7.2",
    "parcel-plugin-markdown": "^0.3.1",
    "react": "^0.14.0 || ^15.0.0-0 || ^16.0.0-0",
    "react-dom": "^16.2.0",
    "react-iframe": "^1.3.3",
    "react-redux": "^5.0.7",
    "react-router-dom": "^4.3.1",
    "redux": "^2.0.0 || ^3.0.0 || ^4.0.0-0",
    "redux-actions": "^2.6.1",
    "redux-axios-middleware": "^4.0.0",
    "simple-markdown": "^0.4.2",
    "slate": "^0.38.1",
    "slate-plain-serializer": "^0.6.0",
    "slate-react": "^0.16.1"
  },
  "devDependencies": {
    "babel-preset-env": "^1.7.0",
    "babel-preset-react": "^6.24.1",
    "firebase-tools": "^3.19.3",
    "parcel-bundler": "^1.5.1"
  }

Кто-нибудь имеет представление, что является причиной этой ошибки и из какой зависимости? Я пытался удалить все зависимости от babel, просто для проверки, но все равно получил ошибку.

1 Ответ

0 голосов
/ 12 ноября 2018

Использование пряжи в конвейере вместо npm решило проблему. В любом случае я использовал пряжу в разработке.

...