ionic-team / ionic-team/ionic-cli
"Cannot find module" when trying to build app
- 主要語言
- TypeScript
- 星號
- 2k
- 分支
- 682
- PR 合併指標
- 30 天內沒有已合併 PR
描述
**Description:**
I have to run `ionic repair` now on a regular basis for being able to run, prepare or build my up.
This happens after using ionic cli a few times (usually i do runs, builds and prepares). Although i did not count: so i can't say if it happens always after the same count of usages.
**Output:**
```
> ionic-app-scripts build --prod --target cordova --platform ios
internal/modules/cjs/loader.js:236
throw err;
^
Error: Cannot find module '/Users/jpf/Documents/projects/mobile-customer-app/node_modules/webpack-sources/node_modules/source-map/source-map.js'. Please verify that the package.json has a valid "main" entry
at tryPackage (internal/modules/cjs/loader.js:228:19)
at Function.Module._findPath (internal/modules/cjs/loader.js:365:18)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:612:27)
at Function.Module._load (internal/modules/cjs/loader.js:527:27)
at Module.require (internal/modules/cjs/loader.js:683:19)
at require (internal/modules/cjs/helpers.js:16:16)
at Object. (/Users/jpf/Documents/projects/mobile-customer-app/node_modules/webpack-sources/lib/Source.js:7:18)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:643:32) {
code: 'MODULE_NOT_FOUND',
path: '/Users/jpf/Documents/projects/mobile-customer-app/node_modules/webpack-sources/node_modules/source-map/package.json',
requestPath: 'source-map'
```
**Steps to Reproduce:**
Just use the cli during the development process.
**My `ionic info`:**
```
Ionic:
Ionic CLI : 5.2.3 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic-angular 3.9.8
@ionic/app-scripts : 3.2.4
Cordova:
Cordova CLI : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : android 8.0.0, ios 4.5.5
Cordova Plugins : cordova-plugin-ionic-webview 1.2.1, (and 17 other plugins)
Utility:
cordova-res : 0.6.0
native-run : 0.2.8
System:
Android SDK Tools : 26.1.1 (/Users/jpf/Library/Android/sdk)
ios-deploy : 1.9.4
NodeJS : v12.6.0 (/usr/local/Cellar/node/12.6.0/bin/node)
npm : 6.9.0
OS : macOS Mojave
Xcode : Xcode 10.3 Build version 10G8
```
貢獻指南
研究方向
Start by reproducing the `ionic-app-scripts build --prod --target cordova --platform ios` failure with the reported Ionic CLI, Node.js, and npm versions. Inspect `webpack-sources/lib/Source.js` and the missing `source-map` path under `node_modules`; done means builds, prepares, and runs work without repeatedly using `ionic repair`.
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- node.js, typescript, webpack
- 領域
- build-system, cli
- Issue 類型
- 缺陷
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 停滯
- 描述清晰度
- 需要釐清
- 新手友好度
- 30/100