Mi Be
Mi Be

Reputation: 450

Error: Cannot find module '@angular/tsc-wrapped/src/tsc' ionicjs ionic view

I get following error when try to compile ionic 3 app with ionic-view (www.ionicjs.com)

Error: Cannot find module '@angular/tsc-wrapped/src/tsc'
    at Function.Module._resolveFilename (module.js:485:15)
    at Function.Module._load (module.js:437:25)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object. (/usr/src/app/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:7:13)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
npm info lifecycle [email protected]~build: Failed to exec build script
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `ionic-app-scripts build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/gitlab-runner/.npm/_logs/2017-09-25T14_14_22_583Z-debug.log
/snapshot.sh: line 32: [: missing `]'
npm run build failed
Make sure your project has a build script in the package.json
Failed to upload build to storage please retry your build.
Running after script...
$ clean-up
Cleaning up files...
Successful clean up
ERROR: Job failed: exit status 1

I work with following Versions:

"@angular/tsc-wrapped": "4.4.3",
"@ionic/cli-plugin-ionic-angular": "1.4.1"
"ionic": "3.12.0",
"rxjs": "^5.4.3",
"tslint": "^5.7.0",
"tslint-loader": "^3.5.3"

npm v 4.6.1
node v 8.5.0

None of the solutions at the web can solve this issue for me.

Upvotes: 1

Views: 3191

Answers (2)

David Smit
David Smit

Reputation: 839

Try this:

npm install npm@latest -g
npm uninstall -g angular-cli
npm cache clean
npm install -g angular-cli@latest
npm install @angular/tsc-wrapped autoprefixer

https://github.com/angular/angular-cli/issues/3183#issuecomment-261740427

I additionally had to (but dont think this is only related to my case):

npm rebuild node-sass

Upvotes: 0

David
David

Reputation: 7507

I guess this should fix it:

  • upgrade npm to the latest version (5.3.0), I personally stayed at 5.1.0 because there were issues with ionic and version 5.2.0 but I think it is fixed in the current version
  • rm -rf node_modules package-lock.json (on Windows: delete node_modules and package-lock.json manually)
  • npm install

If it still does not work you can try to manually install tsc-wrapped:

npm install --save-dev @angular/tsc-wrapped

Upvotes: 5

Related Questions