gpt4 book ai didi

ionic-framework - Ionic 2 构建错误(找不到模块 '../dist/build')

转载 作者:行者123 更新时间:2023-12-03 12:31:46 28 4
gpt4 key购买 nike

我尝试使用 Ionic 2 和 Electron 构建桌面应用程序。

因此我关注了https://blog.couchbase.com/create-a-desktop-app-that-syncs-using-electron-pouchdb-ionic-2-and-couchbase/教程

但是使用 Ionic 2.1.12 和 ionic-app-scripts 0.0.47(如果我尝试使用 ionic-app-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:\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 ]

最佳答案

我在尝试时遇到了同样的错误,并且仔细查看了语句
错误:找不到模块 '../dist/build;'

注意分号?

将 package.json 中的行更改为

“Electron ”:“ ionic 应用脚本构建 Electron 。”

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

关于ionic-framework - Ionic 2 构建错误(找不到模块 '../dist/build'),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42737885/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com