Rendering problems with Angular4 / Typescript

0

In relation to Angular 4 , when I make changes in variables that are called through {{ }} , there is no change in html . Also, if I write the ng serve command, I get the following error:

  

Local workspace file ('angular.json') could not be found.

When checking which version I have with the ng -v command, it gives the following error:

  

Error: ENOENT: no such file or directory, scandir 'C: \ Users \ user \ node_modules'       at Object.fs.readdirSync (fs.js: 904: 18)       at VersionCommand.run (C: \ Users \ user \ AppData \ Roaming \ npm \ node_modules \ @angular \ cli \ commands \ version.js: 55: 41)       at Object. (C: \ Users \ user \ AppData \ Roaming \ npm \ node_modules \ @angular \ cli \ models \ command-runner.js: 150: 28)       at Generator.next ()       at fulfilled (C: \ Users \ user \ AppData \ Roaming \ npm \ node_modules \ @angular \ cli \ models \ command-runner.js: 11: 58)       at       at process._tickCallback (internal / process / next_tick.js: 188: 7)       at Function.Module.runMain (module.js: 695: 11)       at startup (bootstrap_node.js: 191: 16)       at bootstrap_node.js: 612: 3

    
asked by Inca 15.08.2018 в 11:56
source

1 answer

0

sounds like a problem of your cli version, you can check in your pakage.json if it is equal to the version you have installed, you can see the installed version using

ng -v

once you check the error, you can either update your cli, or a downgrade:

// Downgrade
npm uninstall -D @angular/cli // siendo -D tu proyecto local
npm install -D @angular/[email protected] // siendo x.x.x la version a la que quieres bajar.
si quieres la ultima version en lugar de los numeros de version usa latest


// Update
npm install -g @angular/[email protected] // esto actualizara la version global de tu cli, siendo -g global, es decir actualizaras globalmente el cli.
si quieres la ultima version en lugar de los numeros de version usa latest

It is important to have both global and local versions in the same version, because the latest version of the cli stopped using .angular-cli.json and in turn it started to use angular .json .

    
answered by 15.08.2018 в 15:19