-1

Estou com um projeto pronto para publicação, o qual foi criado com Ionic 2 utilizando API do Firebase do Google, porém quando tento buildar o projeto para produção, com o seguinte comando no Git Bash: "npm run prod", é exibido um erro no qual não consegui identificar. Segue o erro abaixo:

$ npm run prod

> [email protected] prod C:\nodejs\apps\ionic2\Ionic2FirebaseChat
> ionic-app-scripts build --prod

[16:17:40]  ionic-app-scripts 3.0.0
[16:17:40]  build prod started ...
[16:17:42]  clean started ...
[16:17:42]  clean finished in 117 ms
[16:17:42]  copy started ...
[16:17:42]  deeplinks started ...
[16:17:42]  deeplinks finished in 177 ms
[16:17:42]  ngc started ...
[16:18:14]  ngc finished in 31.45 s
[16:18:14]  preprocess started ...
[16:18:14]  copy finished in 32.34 s
[16:18:14]  preprocess finished in 285 ms
[16:18:14]  webpack started ...
[16:19:07]  ionic-app-script task: "build"
[16:19:07]  Error: ./models/chat.model.ts Module build failed: Error: ENOENT: no such file or directory, open
            'C:\nodejs\apps\ionic2\Ionic2FirebaseChat\models\chat.model.js' at Error (native) @ ./src/pages/home/home.ts
            10:0-50 @ ./src/pages/sign/sign.ts @ ./src/components/base.component.ts @
            ./src/components/user-menu/user-menu.component.ts @ ./src/app/app.component.ngfactory.ts @
            ./src/app/app.module.ngfactory.ts @ ./src/app/main.ts,./models/message.model.ts Module build failed: Error:
            ENOENT: no such file or directory, open 'C:\nodejs\apps\ionic2\Ionic2FirebaseChat\models\message.model.js'
            at Error (native) @ ./src/pages/chat/chat.ts 4:0-56 @ ./src/app/app.module.ts @
            ./src/app/app.module.ngfactory.ts @ ./src/app/main.ts,./models/user.model.ts Module build failed: Error:
            ENOENT: no such file or directory, open 'C:\nodejs\apps\ionic2\Ionic2FirebaseChat\models\user.model.js' at
            Error (native) @ ./src/components/user-menu/user-menu.component.ts 6:0-50 @
            ./src/app/app.component.ngfactory.ts @ ./src/app/app.module.ngfactory.ts @ ./src/app/main.ts
Error: ./models/chat.model.ts
Module build failed: Error: ENOENT: no such file or directory, open 'C:\nodejs\apps\ionic2\Ionic2FirebaseChat\models\chat.model.js'
    at Error (native)
 @ ./src/pages/home/home.ts 10:0-50
 @ ./src/pages/sign/sign.ts
 @ ./src/components/base.component.ts
 @ ./src/components/user-menu/user-menu.component.ts
 @ ./src/app/app.component.ngfactory.ts
 @ ./src/app/app.module.ngfactory.ts
 @ ./src/app/main.ts,./models/message.model.ts
Module build failed: Error: ENOENT: no such file or directory, open 'C:\nodejs\apps\ionic2\Ionic2FirebaseChat\models\message.model.js'
    at Error (native)
 @ ./src/pages/chat/chat.ts 4:0-56
 @ ./src/app/app.module.ts
 @ ./src/app/app.module.ngfactory.ts
 @ ./src/app/main.ts,./models/user.model.ts
Module build failed: Error: ENOENT: no such file or directory, open 'C:\nodejs\apps\ionic2\Ionic2FirebaseChat\models\user.model.js'
    at Error (native)
 @ ./src/components/user-menu/user-menu.component.ts 6:0-50
 @ ./src/app/app.component.ngfactory.ts
 @ ./src/app/app.module.ngfactory.ts
 @ ./src/app/main.ts
    at BuildError.Error (native)
    at new BuildError (C:\nodejs\apps\ionic2\Ionic2FirebaseChat\node_modules\@ionic\app-scripts\dist\util\errors.js:16:28)
    at callback (C:\nodejs\apps\ionic2\Ionic2FirebaseChat\node_modules\@ionic\app-scripts\dist\webpack.js:123:28)
    at emitRecords.err (C:\nodejs\apps\ionic2\Ionic2FirebaseChat\node_modules\webpack\lib\Compiler.js:269:13)
    at Compiler.emitRecords (C:\nodejs\apps\ionic2\Ionic2FirebaseChat\node_modules\webpack\lib\Compiler.js:375:38)
    at emitAssets.err (C:\nodejs\apps\ionic2\Ionic2FirebaseChat\node_modules\webpack\lib\Compiler.js:262:10)
    at applyPluginsAsyncSeries1.err (C:\nodejs\apps\ionic2\Ionic2FirebaseChat\node_modules\webpack\lib\Compiler.js:368:12)
    at next (C:\nodejs\apps\ionic2\Ionic2FirebaseChat\node_modules\tapable\lib\Tapable.js:218:11)
    at Compiler.compiler.plugin (C:\nodejs\apps\ionic2\Ionic2FirebaseChat\node_modules\webpack\lib\performance\SizeLimitsPlugin.js:99:4)
    at Compiler.applyPluginsAsyncSeries1 (C:\nodejs\apps\ionic2\Ionic2FirebaseChat\node_modules\tapable\lib\Tapable.js:222:13)

npm ERR! Windows_NT 10.0.15063
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "prod"
npm ERR! node v6.11.4
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] prod: `ionic-app-scripts build --prod`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] prod script 'ionic-app-scripts build --prod'.
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 Ionic2FirebaseChat package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     ionic-app-scripts build --prod
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs Ionic2FirebaseChat
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls Ionic2FirebaseChat
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\nodejs\apps\ionic2\Ionic2FirebaseChat\npm-debug.log

Minhas configurações da aplicação são estas:

cli packages: (C:\Users\chris\AppData\Roaming\npm\node_modules)

    @ionic/cli-utils  : 1.13.1
    ionic (Ionic CLI) : 3.13.1

global packages:

    cordova (Cordova CLI) : 6.5.0

local packages:

    @ionic/app-scripts : 3.0.0
    Cordova Platforms  : browser 4.1.0
    Ionic Framework    : ionic-angular 3.7.1

System:

    Android SDK Tools : 25.2.5
    Node              : v6.11.4
    npm               : 3.10.10
    OS                : Windows 10

Misc:

    backend : pro

1 Resposta 1

0

Tente rodar npm run production ao invés de npm run prod.

Pode ser a versão do Node.js... Atualize a versão com o comando: npm update -g.

2
  • Rodei o comando para atualização do node.js, e tentei rodar o comando npm run production ao invés de npm run prod. Mas não deu certo também, exibindo erros de npm ERR!, muito semelhantes ao do comando recente "npm run prod". Commented 23/10/2017 às 13:09
  • Achei meu erro. Tratava-se de uma pasta que criei de código fora da pasta destinada a tal, a "src". Passei esta para a pasta correta e o Build funcionou corretamente. De qualquer forma, obrigado pelo auxílio. Commented 23/10/2017 às 16:23

Você deve fazer log-in para responder a esta pergunta.

Esta não é a resposta que você está procurando? Pesquise outras perguntas com a tag .