Error: Cannot find module './'

Error: Cannot find module './'

我在尝试通过 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/Whosebug/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"
  }
}

更新

解决上面的错误后,抛出如下错误

我是 运行 通过 bash 在 windows 10,并尝试安装所有必需的库以使电子应用程序通过 [=33= 上的 npm start 启动](在我的 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 使事情过于复杂