Ionic app,错误:..main.ts模块构建失败:错误:ENOENT

问题描述 投票:0回答:1

在这里,我有使用Firebase和Google集成的Ionic v4应用程序

离子信息显示:

Ionic:
   ionic (Ionic CLI)  : 4.12.0 (C:\Users\xxx\AppData\Roaming\nvm\v10.15.3\node_modules\ionic)
   Ionic Framework    : ionic-angular 3.9.3
   @ionic/app-scripts : 3.2.3

Cordova:
   cordova (Cordova CLI) : 8.1.2 ([email protected])
   Cordova Platforms     : android 7.1.4
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 1.2.1, (and 22 other plugins)

System:
   NodeJS : v10.15.3 (C:\Program Files\nodejs\node.exe)
   npm    : 6.4.1
   OS     : Windows 10

Main.ts包含这个

 {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
import {AppModule} from './app.module';
platformBrowserDynamic().bootstrapModule(AppModule);

运行后出现问题:ionic build android

[15:54:08]  ionic-app-script task: "build"
[15:54:08]  Error: C:/PATH/Ionic/src/app/main.ts Module build failed: Error: ENOENT: no
            such file or directory, open 'C:\PATH\Ionic\src\app\main.js'
Error: C:/Users/Jasko/Dropbox/Projects/Real.Me/Ionic/src/app/main.ts
Module build failed: Error: ENOENT: no such file or directory, open 'C:\PATH\Ionic\src\app\main.js'
    at new BuildError (C:\PATH\Ionic\node_modules\@ionic\app-scripts\dist\util\errors.js:16:28)
    at callback (C:\PATH\Ionic\node_modules\@ionic\app-scripts\dist\webpack.js:121:28)
    at emitRecords.err (C:\PATH\Ionic\node_modules\webpack\lib\Compiler.js:265:13)
    at Compiler.emitRecords (C:\PATH\Ionic\node_modules\webpack\lib\Compiler.js:371:38)
    at emitAssets.err (C:\PATH\Ionic\node_modules\webpack\lib\Compiler.js:258:10)
    at applyPluginsAsyncSeries1.err (C:\PATH\Ionic\node_modules\webpack\lib\Compiler.js:364:12)
    at next (C:\PATH\Ionic\node_modules\tapable\lib\Tapable.js:218:11)
    at Compiler.compiler.plugin (C:\PATH\Ionic\node_modules\webpack\lib\performance\SizeLimitsPlugin.js:99:4)
    at Compiler.applyPluginsAsyncSeries1 (C:\PATH\Ionic\node_modules\tapable\lib\Tapable.js:222:13)
    at Compiler.afterEmit (C:\PATH\Ionic\node_modules\webpack\lib\Compiler.js:361:9)
[ERROR] An error occurred while running subprocess ionic-app-scripts.

谁知道在哪里寻找错误?

cordova ionic-framework npm ionic4
1个回答
0
投票

该问题是由Windows Symlink文件夹引起的。一旦我将源代码移动到另一个驱动器,它就成功运行了。绝对是一个离子BUG

© www.soinside.com 2019 - 2024. All rights reserved.