gpt4 book ai didi

javascript - 错误: Cannot find module './'

转载 作者:行者123 更新时间:2023-11-28 05:40:41 27 4
gpt4 key购买 nike

我在尝试通过 NPM start 启动我的应用程序时偶然发现了此错误。我不确定问题出在哪里,因为它在我的另一台计算机上运行良好(我将文件解压缩到这台计算机上运行,​​npm install以防万一,然后尝试启动它,但下面抛出以下错误)。

如有任何帮助,我们将不胜感激。

    module.js:340
throw err;
^
Error: Cannot find module './'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/mnt/c/Users/Jonathan/Desktop/client/<NAME>/node_modules/.bin/electron:3:16)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)

npm ERR! Linux 3.4.0+
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "start"
npm ERR! node v0.10.46
npm ERR! npm v2.15.1
npm ERR! code ELIFECYCLE
npm ERR! <NAME>@0.0.0 start: `electron main.js`
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the <NAME>@0.0.0 start script 'electron main.js'.
npm ERR! This is most likely a problem with the <NAME> package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! electron main.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs <NAME>
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls <NAME>
npm ERR! There is likely additional logging output above.

package.json

{
"name": "<NAME>",
"version": "0.0.0",
"description": "[..]",
"main": "index.js",
"build": {
"appId": "test.321",
"app-category-type": "your.app.category.type",
"win": {
"iconUrl": "http://cdn.sstatic.net/Sites/stackoverflow/img/apple-touch-icon.png"
}
},
"scripts": {
"start": "electron main.js",
"postinstall": "install-app-deps",
"pack": "build --dir",
"dist": "build"
},
"author": "john@gmail.com>",
"license": "ISC",
"devDependencies": {
"electron": "^1.3.3",
"electron-installer-squirrel-windows": "^1.3.0",
"electron-packager": "^7.5.1"
}
}

更新

解决上述错误后,抛出以下错误

我在 Windows 10 上通过 bash 运行它,并尝试安装所有必需的库,以便通过 Windows 上的 npm start 启动 Electron 应用程序(在我的 ubuntu 中工作正常)

electron main.js

    [8002:0814/084446:FATAL:render_sandbox_host_linux.cc(40)] Check failed: 0 == shutdown(renderer_socket_, SHUT_RD). shutdown: Invalid argument
#0 0x000001e098ce <unknown>
#1 0x000001e1f4db <unknown>
#2 0x000001e1fa9d <unknown>
#3 0x000002892fc2 <unknown>
#4 0x00000265e599 <unknown>
#5 0x000002664b5f <unknown>
#6 0x00000265dc36 <unknown>
#7 0x000001204157 <unknown>
#8 0x000001202c30 <unknown>
#9 0x0000033a9470 main
#10 0x7fe5ec701f45 __libc_start_main
#11 0x000000575039 <unknown>

最佳答案

shutdown 检查失败是 known issue 。 Electron 作为原生 Windows 应用程序运行得很好,因此只需这样做即可,而不是在 Windows 上使用 Bash 让事情变得过于复杂。

关于javascript - 错误: Cannot find module './' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38943496/

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