离子 2 构建错误(找不到模块 '../dist/build')



我尝试用离子2和电子构建桌面应用。

因此,我跟随https://blog.couchbase.com/create-a-desktop-app-that-syncs-using-electron-pouchdb-ionic-2-and-couchbase/tutorial

但使用离子2.1.12和Ionic-Apps-Scripts 0.0.47(如果我使用Ionic-Apps-scripts 1.1.4尝试,我会遇到相同的错误),我会收到以下错误:

[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.

详细的日志文件看起来像:

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 npm@4.4.1
3 info using node@v7.7.1
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:Userselang_000AppDataRoamingnpmnode_modulesnpmbinnode-gyp-bin;D:Projektetodolite-electron-puchdbnode_modules.bin;C:ProgramDataOracleJavajavapath;C:Program Files (x86)InteliCLS Client;C:Program FilesInteliCLS Client;C:WINDOWSsystem32;C:WINDOWS;C:WINDOWSSystem32Wbem;C:WINDOWSSystem32WindowsPowerShellv1.0;C:Program Files (x86)Windows LiveShared;C:Program FilesIntelIntel(R) Management Engine ComponentsDAL;C:Program FilesIntelIntel(R) Management Engine ComponentsIPT;C:Program Files (x86)IntelIntel(R) Management Engine ComponentsDAL;C:Program Files (x86)IntelIntel(R) Management Engine ComponentsIPT;C:Program Files (x86)ATI TechnologiesATI.ACECore-Static;C:Program Files (x86)QuickTimeQTSystem;C:Program Files (x86)AMDATI.ACECore-Static;C:Program Files (x86)SkypePhone;C:Program FilescURLbin;C:Program Filesnodejs;C:Program Files (x86)GoogleChromeApplication;C:ProgramDataOracleJavajavapath;C:Program Files (x86)InteliCLS Client;C:Program FilesInteliCLS Client;C:WINDOWSsystem32;C:WINDOWS;C:WINDOWSSystem32Wbem;C:WINDOWSSystem32WindowsPowerShellv1.0;C:Program Files (x86)Windows LiveShared;C:Program FilesIntelIntel(R) Management Engine ComponentsDAL;C:Program FilesIntelIntel(R) Management Engine ComponentsIPT;C:Program Files (x86)IntelIntel(R) Management Engine ComponentsDAL;C:Program Files (x86)IntelIntel(R) Management Engine ComponentsIPT;C:Program Files (x86)ATI TechnologiesATI.ACECore-Static;C:Program Files (x86)QuickTimeQTSystem;C:Program Files (x86)AMDATI.ACECore-Static;C:Program Files (x86)SkypePhone;C:Userselang_000AppDataLocalProgramsGitcmd;C:Windowstwain_32CNQL60;C:Userselang_000AppDataLocalPandoc;C:Userselang_000AppDataLocalMicrosoftWindowsApps;C:Program FilescURLbin;C:Userselang_000AppDataRoamingnpm
10 verbose lifecycle ionic-hello-world@~electron: CWD: D:Projektetodolite-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:Userselang_000AppDataRoamingnpmnode_modulesnpmlibutilslifecycle.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:Userselang_000AppDataRoamingnpmnode_modulesnpmlibutilsspawn.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:Projektetodolite-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 ]

我在尝试时只是碰到相同的错误,并且仔细观察了该语句错误:找不到模块'../dist/build;'

注意分号?

将package.json中的行更改为

"电子":" Ionic-App-Scripts构建电子。"

然后可以在 @ionic中找到任务,并将执行构建

相关内容

  • 没有找到相关文章

最新更新