Clansi
Clansi

Reputation: 123

Ionic 2 build error (Cannot find module '../dist/build')

I try to build an desktop app with Ionic 2 and Electron.

Therefore I followed the https://blog.couchbase.com/create-a-desktop-app-that-syncs-using-electron-pouchdb-ionic-2-and-couchbase/ tutorial

But with Ionic 2.1.12 and ionic-app-scripts 0.0.47 (I get the same error if I try it with ionic-app-scripts 1.1.4) I get the following error:

[17:19:44]  ionic-app-scripts 0.0.47 
[17:19:44]  ionic-app-script task: "build;" 
[17:19:44]  Error: Cannot find module '../dist/build;' 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ionic-hello-world@ electron: `ionic-app-scripts build; electron .`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ionic-hello-world@ electron script 'ionic-app-scripts build; electron .'.
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 ionic-hello-world package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     ionic-app-scripts build; electron .
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs ionic-hello-world
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls ionic-hello-world
npm ERR! There is likely additional logging output above.

The detailed log file looks like:

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Users\\elang_000\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'electron' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'preelectron', 'electron', 'postelectron' ]
5 info lifecycle ionic-hello-world@~preelectron: ionic-hello-world@
6 silly lifecycle ionic-hello-world@~preelectron: no script for preelectron, continuing
7 info lifecycle ionic-hello-world@~electron: ionic-hello-world@
8 verbose lifecycle ionic-hello-world@~electron: unsafe-perm in lifecycle true
9 verbose lifecycle ionic-hello-world@~electron: PATH: C:\Users\elang_000\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin;D:\Projekte\todolite-electron-puchdb\node_modules\.bin;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files (x86)\AMD\ATI.ACE\Core-Static;C:\Program Files (x86)\Skype\Phone\;C:\Program Files\cURL\bin;C:\Program Files\nodejs\;C:\Program Files (x86)\Google\Chrome\Application;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files (x86)\AMD\ATI.ACE\Core-Static;C:\Program Files (x86)\Skype\Phone\;C:\Users\elang_000\AppData\Local\Programs\Git\cmd;C:\Windows\twain_32\CNQL60;C:\Users\elang_000\AppData\Local\Pandoc\;C:\Users\elang_000\AppData\Local\Microsoft\WindowsApps;C:\Program Files\cURL\bin;C:\Users\elang_000\AppData\Roaming\npm
10 verbose lifecycle ionic-hello-world@~electron: CWD: D:\Projekte\todolite-electron-puchdb
11 silly lifecycle ionic-hello-world@~electron: Args: [ '/d /s /c', 'ionic-app-scripts build; electron .' ]
12 silly lifecycle ionic-hello-world@~electron: Returned: code: 1  signal: null
13 info lifecycle ionic-hello-world@~electron: Failed to exec electron script
14 verbose stack Error: ionic-hello-world@ electron: `ionic-app-scripts build; electron .`
14 verbose stack Exit status 1
14 verbose stack     at EventEmitter.<anonymous> (C:\Users\elang_000\AppData\Roaming\npm\node_modules\npm\lib\utils\lifecycle.js:279:16)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at EventEmitter.emit (events.js:194:7)
14 verbose stack     at ChildProcess.<anonymous> (C:\Users\elang_000\AppData\Roaming\npm\node_modules\npm\lib\utils\spawn.js:40:14)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at ChildProcess.emit (events.js:194:7)
14 verbose stack     at maybeClose (internal/child_process.js:899:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid ionic-hello-world@
16 verbose cwd D:\Projekte\todolite-electron-puchdb
17 verbose Windows_NT 10.0.14393
18 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\elang_000\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "electron"
19 verbose node v7.7.1
20 verbose npm  v4.4.1
21 error code ELIFECYCLE
22 error errno 1
23 error ionic-hello-world@ electron: `ionic-app-scripts build; electron .`
23 error Exit status 1
24 error Failed at the ionic-hello-world@ electron script 'ionic-app-scripts build; electron .'.
24 error Make sure you have the latest version of node.js and npm installed.
24 error If you do, this is most likely a problem with the ionic-hello-world package,
24 error not with npm itself.
24 error Tell the author that this fails on your system:
24 error     ionic-app-scripts build; electron .
24 error You can get information on how to open an issue for this project with:
24 error     npm bugs ionic-hello-world
24 error Or if that isn't available, you can get their info via:
24 error     npm owner ls ionic-hello-world
24 error There is likely additional logging output above.
25 verbose exit [ 1, true ]

Upvotes: 0

Views: 436

Answers (1)

I just hit the same error when I tried it, and it had a closer look at the statement Error: Cannot find module '../dist/build;'

notice the semicolon ?

Change the line in package.json to

"electron": "ionic-app-scripts build electron ."

Then it can find the task in @ionic and will perform the build

Upvotes: 2

Related Questions