2016-02-17 5 views
0

Мне нужно redux-form-3.0.8 и загружено исходный код от github.Ошибка при компиляции с babel

Я попытался выполнить 'npm run build', чтобы скомпилировать его, но получил следующую ошибку.

C:\Users\xxxxx\Downloads\redux-form-3.0.8\redux-form-3.0.8>npm run build 

> [email protected] build C:\Users\xxxxx\Downloads\redux-form-3.0.8\redux-form- 
3.0.8 
> npm run build:lib && npm run build:umd && npm run build:umd:min 


> [email protected] build:lib C:\Users\xxxxx\Downloads\redux-form-3.0.8\redux-f 
orm-3.0.8 
> babel src --out-dir lib 

ReferenceError: [BABEL] src\actions.js: Unknown option: C:\Users\xxxxx\Downloa 
ds\redux-form-3.0.8\redux-form-3.0.8\.babelrc.stage 
    at Logger.error (C:\Users\xxxxx\AppData\Roaming\npm\node_modules\babel-cli 
\node_modules\babel-core\lib\transformation\file\logger.js:41:11) 
    at OptionManager.mergeOptions (C:\Users\xxxxx\AppData\Roaming\npm\node_mod 
ules\babel-cli\node_modules\babel-core\lib\transformation\file\options\option-ma 
nager.js:262:18) 
    at OptionManager.addConfig (C:\Users\xxxxx\AppData\Roaming\npm\node_module 
s\babel-cli\node_modules\babel-core\lib\transformation\file\options\option-manag 
er.js:221:10) 
    at OptionManager.findConfigs (C:\Users\xxxxx\AppData\Roaming\npm\node_modu 
les\babel-cli\node_modules\babel-core\lib\transformation\file\options\option-man 
ager.js:364:16) 
    at OptionManager.init (C:\Users\xxxxx\AppData\Roaming\npm\node_modules\bab 
el-cli\node_modules\babel-core\lib\transformation\file\options\option-manager.js 
:412:12) 
    at File.initOptions (C:\Users\xxxxx\AppData\Roaming\npm\node_modules\babel 
-cli\node_modules\babel-core\lib\transformation\file\index.js:190:75) 
    at new File (C:\Users\xxxxx\AppData\Roaming\npm\node_modules\babel-cli\nod 
e_modules\babel-core\lib\transformation\file\index.js:121:22) 
    at Pipeline.transform (C:\Users\xxxxx\AppData\Roaming\npm\node_modules\bab 
el-cli\node_modules\babel-core\lib\transformation\pipeline.js:42:16) 
    at transform (C:\Users\xxxxx\AppData\Roaming\npm\node_modules\babel-cli\li 
b\babel\util.js:53:22) 
    at Object.compile (C:\Users\xxxxx\AppData\Roaming\npm\node_modules\babel-c 
li\lib\babel\util.js:62:12) 

Я обнаружил, что 'НПМ перспективе построить' позвонит 'столпотворение ЦСИ --out-реж Lib' во-первых, в package.json. Таким образом, это были ошибки babel команда.

Ниже приведена версия моего барабана. C: \ Users \ хххххх \ node_modules \ перевождь-форма>столпотворение --version 6.2.0 (столпотворение-ядро 6.2.1)

Не могли бы вы сказать мне, как обойти эту проблему? Благодарю.

Я знал, что могу напрямую установить скомпилированную версию, как показано ниже, но у меня все еще есть ошибка, я расстроен.

C:\Users\xxxxx\node_modules>npm install [email protected] 
npm WARN checkPermissions Missing write access to C:\Users\xxxxx\node_modules\ 
redux-form 
[email protected] C:\Users\xxxxx 
├── UNMET PEER DEPENDENCY [email protected]* 
├── UNMET PEER DEPENDENCY [email protected]^3.0.0 || ^4.0.0 
├── [email protected] extraneous 
└── UNMET PEER DEPENDENCY [email protected]* 

npm WARN EPEERINVALID [email protected] requires a peer of [email protected]* but non 
e was installed. 
npm WARN EPEERINVALID [email protected] requires a peer of [email protected]* but none w 
as installed. 
npm WARN EPEERINVALID [email protected] requires a peer of [email protected]^3.0.0 || 
^4.0.0 but none was installed. 
npm ERR! Windows_NT 6.1.7601 
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\xxxxx\\AppData 
\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "[email protected]" 

npm ERR! node v4.1.1 
npm ERR! npm v3.3.6 
npm ERR! path C:\Users\xxxxx\node_modules\redux-form 
npm ERR! code ENOENT 
npm ERR! errno -4058 
npm ERR! syscall access 

npm ERR! enoent ENOENT: no such file or directory, access 'C:\Users\xxxxx\node 
_modules\redux-form' 
npm ERR! enoent This is most likely not a problem with npm itself 
npm ERR! enoent and is related to npm not being able to find a file. 
npm ERR! enoent 

npm ERR! Please include the following file with any support request: 
npm ERR!  C:\Users\xxxxx\node_modules\npm-debug.log 

ответ

2

Поскольку столпотворение 6 не совместит для старого .babelrc

Вот некоторые решения:

  1. попытаться удалить все .babelrc и добавить параметры в ваш WebPack config.js
  2. использование babel 5

Ref: https://github.com/babel/babel-loader/issues/132

Смежные вопросы