Obtendo o erro enquanto 'npm run build'

0

Qual pode ser o problema?

> @ build /home/mafia/repo
> npm run build:src && npm run build:test


> @ build:src /home/mafia/repo
> babel src/main/webapp/js/ -x ".es6" -d src/main/webapp/js/

Error: Cannot find module 'electron-to-chromium' (While processing preset: "/home/mafia/repo/node_modules/babel-preset-env/lib/index.js")
    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 (internal/module.js:20:19)
    at Object.<anonymous> (/home/mafia/repo/node_modules/babel-preset-env/lib/normalize-options.js:11:27)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)

npm ERR! Linux 4.4.0-71-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "build:src"
npm ERR! node v7.8.0
npm ERR! npm  v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ build:src: 'babel src/main/webapp/js/ -x ".es6" -d src/main/webapp/js/'
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ build:src script 'babel src/main/webapp/js/ -x ".es6" -d src/main/webapp/js/'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     babel src/main/webapp/js/ -x ".es6" -d src/main/webapp/js/
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs 
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls 
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/mafia/.npm/_logs/2017-04-09T18_06_55_612Z-debug.log

npm ERR! Linux 4.4.0-71-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "build"
npm ERR! node v7.8.0
npm ERR! npm  v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ build: 'npm run build:src && npm run build:test'
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ build script 'npm run build:src && npm run build:test'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm run build:src && npm run build:test
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs 
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls 
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/mafia/.npm/_logs/2017-04-09T18_06_55_684Z-debug.log
    
por tarun14110 09.04.2017 / 18:10

1 resposta

2

Sua pergunta parece não ser sobre o Ubuntu, mas é uma questão geral de programação.

No entanto, se você realmente olhou para a saída, você teria visto a linha Cannot find module 'electron-to-chromium' lá, o que indica claramente que seu projeto está faltando no módulo elétron-para-cromo como dependência.

Você deve ser capaz de instalá-lo executando o comando abaixo dentro do diretório do projeto, que também adiciona o módulo à lista de dependências no seu package.json :

npm install --save electron-to-chromium
    
por Byte Commander 09.04.2017 / 18:36