How Do I Resolve a 'No Such File' Error for the URI.js File?

If you get a no such file error for the URI.js file when building or deploying your application using the grunt command line vb-build command, this means that the requirejs optimizer can't find a reference to the urijs library:

Running "_vb-optimize-prepare-ojL10n-plugin:xxxxx" (_vb-optimize-prepare-ojL10n-plugin) task 
downloading ojL10n plugin from https://static.oracle.com/cdn/jet/v7.1.1/default/js/debug/ojL10n.js 
to build/ojL10n.js

Running "requirejs:xxxx" (requirejs) task 
Error: ENOENT: no such file or directory, open 
'C:/xxxx/VBCS/1.0/build/optimized/webApps/test/version_5244468526385398434/urijs/URI.js' 
In module tree: 
    services/daily_impact_list/transforms 

[Error: Error: ENOENT: no such file or directory, open 
'C:/xxx/VBCS/1.0/build/optimized/webApps/test/version_5244468526385398434/urijs/URI.js' 
In module tree: services/daily_impact_list/transforms 
    at xxxxxxx\1.0\node_modules\requirejs\bin\r.js:28332:19 
    at xxxxxxx\1.0\node_modules\requirejs\bin\r.js:3059:39 
    at xxxxxxxxx\1.0\node_modules\requirejs\bin\r.js:2999:25 
    at Function.prim.nextTick (xxxxxxxxx\1.0\node_modules\requirejs\bin\r.js:28083:9) 
    at Object.errback (xxxxxxxxx\1.0\node_modules\requirejs\bin\r.js:2998:26) 
    at Object.callback (xxxxxxxxxxx\1.0\node_modules\requirejs\bin\r.js:2984:23) 
    at Object.then (xxxxxxxxx\1.0\node_modules\requirejs\bin\r.js:3038:23)

To resolve this problem, empty the path to this library for the optimizer using one of these methods:

  • (Recommended) Add the following code to the Gruntfile.js file in the root of the application sources:
    {code:java} 
    grunt.initConfig({ 
        "vb-require-bundle": { 
        crosswalk: { 
        options: { 
        emptyPaths: ["urijs"] 
        } 
        } 
        } 
        }); 
    {code}

    Or

  • Add the {{--emptyPaths=urijs}} option to the grunt vb-build command.