Esri / esri-wab-build

Package used to build ESRI Web App Builder Apps for production.
Apache License 2.0
17 stars 5 forks source link

Error: ENOENT: no such file or directory, scandir '..\server\apps\2\buildOutput\app-packages #78

Open wondie opened 3 years ago

wondie commented 3 years ago

I am getting the error below when I try to build. The buildOutput was is empty when the error happened. Is there any fix or workaround for it? I am using web app builder 2.17.

starting tokenizing resource...
starting processing resource tokens...
starting parsing resource...
Error: spawn java ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
    at onErrorNT (internal/child_process.js:469:16)
    at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  errno: 'ENOENT',
  code: 'ENOENT',
  syscall: 'spawn java',
  path: 'java',
  spawnargs: [
    '-cp',
    'D:\\CIAT\\apps\\WebAppBuilderForArcGIS2.17\\server\\apps\\2\\build-src\\util\\closureCompiler\\compiler.jar;D:\\CIAT\\apps\\WebAppBuilderForArcGIS2.17\\server\\apps\\2\\build-src\\util\\shrinksafe\\js.jar;
D:\\CIAT\\apps\\WebAppBuilderForArcGIS2.17\\server\\apps\\2\\build-src\\util\\shrinksafe\\shrinksafe.jar',
    'org.mozilla.javascript.tools.shell.Main',
    'D:\\CIAT\\apps\\WebAppBuilderForArcGIS2.17\\server\\apps\\2\\build-src\\util\\build\\optimizeRunner.js'
  ]
}
Error: spawn java ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
    at onErrorNT (internal/child_process.js:469:16)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)
build always "fails"
internal/fs/utils.js:269
    throw err;
    ^

Error: ENOENT: no such file or directory, scandir 'D:\CIAT\apps\WebAppBuilderForArcGIS2.17\server\apps\2\buildOutput\app-packages'
    at Object.readdirSync (fs.js:955:3)
    at visitFolderFiles (D:\CIAT\apps\WebAppBuilderForArcGIS2.17\server\apps\2\node_modules\esri-wab-build\app\utilscripts.js:689:18)
    at Object.cleanUncompressedSource (D:\CIAT\apps\WebAppBuilderForArcGIS2.17\server\apps\2\node_modules\esri-wab-build\app\utilscripts.js:889:3)
    at Object.exports.copy (D:\CIAT\apps\WebAppBuilderForArcGIS2.17\server\apps\2\node_modules\esri-wab-build\app\copyapp.js:21:17)
    at Object.exports.build (D:\CIAT\apps\WebAppBuilderForArcGIS2.17\server\apps\2\node_modules\esri-wab-build\app\buildTool.js:132:14)
    at Object.<anonymous> (D:\CIAT\apps\WebAppBuilderForArcGIS2.17\server\apps\2\node_modules\esri-wab-build\app\build:14:15)
    at Module._compile (internal/modules/cjs/loader.js:1137:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
    at Module.load (internal/modules/cjs/loader.js:985:32)
    at Function.Module._load (internal/modules/cjs/loader.js:878:14) {
  errno: -4058,
  syscall: 'scandir',
  code: 'ENOENT',
  path: 'D:\\CIAT\\apps\\WebAppBuilderForArcGIS2.17\\server\\apps\\2\\buildOutput\\app-packages'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! targetingtools@1.0.0 build: `esri-wab-build`
npm ERR! Exit status 1
npm ERR!
capthastings commented 3 years ago

I'm running into this same error. Did you develop a workaround or anything?

>> Error: ENOENT: no such file or directory, scandir '<path...>\buildOutput\app-packages'

HaydnABL commented 3 years ago

I'm running into this same error. Did you develop a workaround or anything?

>> Error: ENOENT: no such file or directory, scandir '<path...>\buildOutput\app-packages'

Running command prompt as admin fixed this for me.

capthastings commented 3 years ago

Running as admin unfortunately did not change anything for me. Thanks, though - hadn't thought of that.

pchapuis commented 3 years ago

I managed to avoid this issue by editing my package.json from my source application by adding some elements (in bold)

{
    "name": "test",
    "version": "1.0.0",
    "description": "<!DOCTYPE html>\r <html>\r <head>\r     <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\r     <meta name=\"viewport\" content=\"initial-scale=1, maximum-scale=1, user-scalable=no\">\r <title>Readme</title>\r   <style>\r .selector{color:red;}\r .heading{\r background-color:#D8E0E2;\r background-repeat:repeat-x;\r border-bottom:1px solid #FFFFFF;\r border-top:1px solid #FFFFFF;\r color:black;\r font-family:Verdana,Arial,Helvetica,sans-serif;\r font-size:16px;\r font-weight:bold;\r letter-spacing:1.1px;\r margin:15px 0 10px;\r padding:3px 10px;\r text-align:center;\r }\r   </style>",
    "main": "env.js",
    "scripts": {
        "test": "echo \"Error: no test specified\" && exit 1",
        **"build": "esri-wab-build"**
    },
    "keywords": [
        "Build"
    ],
    "author": "",
    "license": "ISC",
    **"devDependencies": {
        "esri-wab-build": "^1.1.0"
    }**
}

However, even if it goes further, I do not reach the end of the process... Does anybody have a version of an app from WAB DE that does actually compile ?