ionic-team / ionic-team/ionic-cli

"Cannot find module" when trying to build app

Ouverte
#4,111 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
project type: ionic-angular
Langage dominant
TypeScript
Étoiles
2k
Forks
682
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

**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
```

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.