Build --prod enoent error


#1

Hello everyone when i try to ionic cordova build android --prod it gives I saw lots of similar issue but didn’t help

Error: ./~/ng2-search-filter/src/ng2-filter.pipe.ts
Module build failed: Error: ENOENT: no such file or directory, open 'C:\Users\eg\Desktop\myApp\app\node_modules\ng2-search-filter\src\ng2-filter.pipe.js.map'
 @ ./src/pages/home/home.ngfactory.ts 43:0-66
 @ ./src/app/app.module.ngfactory.ts
 @ ./src/app/main.ts,./~/ng2-search-filter/src/ng2-filter.module.ts
Module build failed: Error: ENOENT: no such file or directory, open 'C:\Users\eg\Desktop\myApp\app\node_modules\ng2-search-filter\src\ng2-filter.module.js.map'
 @ ./src/app/app.module.ngfactory.ts 23:0-68
 @ ./src/app/main.ts

here is my ionic info


    @ionic/cli-utils  : 1.8.1
    ionic (Ionic CLI) : 3.8.1

global packages:

    Cordova CLI : 6.5.0

local packages:

    @ionic/app-scripts : 1.3.7
    Cordova Platforms  : android 6.1.2
    Ionic Framework    : ionic-angular 3.1.1

System:

    Node : v7.9.0
    npm  : 4.1.2
    OS   : Windows 10

Thank you


#2

Upgrade this to a recent version. (Note the breaking changes at 2.x in the changelog)


#3

I did it but now it gives an error Error: Uglify failed: Unexpected token: name (MapModal) in undefined at line undefined, col undefined, pos undefined


#4

Then fix that. Seems oyu have something where it shouldn’t be. Does it build without --prod still?


#5

I can build without prod even i can ionixlc cordova run android but prod doesnt work


#6

It is clearly mentioned .map file is not found.

The .map file is exist here
C:\Users\eg\Desktop\myApp\app\node_modules\ng2-search-filter\dist\src folder so copy that files and paste
C:\Users\eg\Desktop\myApp\app\node_modules\ng2-search-filter\src\ folder.

Please let me know if it not works.


#7

Do not follow the above advice. npm owns the node_modules directory, and you should not manually modify things under it.


#8

then you need to create issue on their github repo. @rapropos My solution was quick fix.


#9

Hi any Solution you found for this