2

After trying to build my frontend project with ng build I get this error message:

ERROR in ./node_modules/pace/node_modules/charm/index.js Module not found: Error: Can't resolve 'tty' in '/workspace/node_modules/pace/node_modules/charm'

Trying npm install tty --save or npm install pace --save does not resolve the issue.

node version is : v11.10.0 angular version : 7.0.0

  • Angular's latest development version is 8. 11 is not possible. Also it seems the difference between AngularJS and Angular might not be clear to you. Please overhaul your question an correct the details so we are able to help you. – jowey Mar 06 '19 at 10:12
  • it's node version sorry – Mohamed Amine Kharrez Mar 06 '19 at 10:13
  • 1
    A ok. Now the information makes more sense. I also removed AngularJS tag with an edit (might not yet be approved). – jowey Mar 06 '19 at 10:17
  • what is your angular version? have you tried cleaning your `node_modules` folder? Please edit your question to reflect the correct versions of angular and node. – Arikael Mar 06 '19 at 10:17
  • @Arikael Yes I did clean `node_modules ` – Mohamed Amine Kharrez Mar 06 '19 at 10:24
  • resolved by modifyng index.js in node_modules/pace/node_modules/charm Have to change `var tty = require('tty');` with `var tty = require('tty-browserify');` – Mohamed Amine Kharrez Mar 06 '19 at 11:18
  • just to be sure: You are installing this `pace`? -> https://www.npmjs.com/package/pace if yes, this hasn't been updated for 7 years. I wouldn't use a package this old. For what do you need `pace`in a angular application (I assume a web application)? – Arikael Mar 06 '19 at 12:20

1 Answers1

-6

resolved by modifyng index.js in node_modules/pace/node_modules/charm

Have to change var tty = require('tty'); with var tty = require('tty-browserify');

  • you should never modify any files in `node_modules` since it will get overwritten everytime you update the package or any time another developer installs packages. – Arikael Mar 06 '19 at 12:14
  • in case you clean yeah, but in case of jut update, no problem – Mohamed Amine Kharrez Mar 06 '19 at 13:29
  • 2
    if the package would get updated (which is highly unlikely) it would be overwritten. In my eyes this is a "solution" destined to fail sometime in the future. – Arikael Mar 06 '19 at 13:39