>PROBLEM
Running the command "ng v", returns:
'ng' is not recognized as an internal command
'ng' não é reconhecido como um comando interno (Portuguese)
>SOLUTION
This procedure is about Windows O.S.
After attempting to solve the problem through other experiences, I got no solution.
My Path seemed to be corrupted and there were no files under the user's folder, for instance at:
C:\Users\<USER>\AppData\Roaming\npm\node_modules
So, to solve the issue, I decided to restart the environment installation from scratch.
This same procedure were executed several times, including restarting the sytem, until the success came. :-)
- Uninstall node.js using the windows "Add remove application...".
- Remove leftovers. Sometimes there are "skeleton" folder left behind. In my case, it was: C:\Users\<USER>\AppData\Roaming\npm\node_modules
- Run the node.js as Administrator. Make sure of that, because it is important.
- After the installation is fineshed, check it:
node --version
npm --version - Install @angular/cli that it is the lib that provides the "ng" command, as global installation (important: not locally).
- The previous command will install the latest version. If you're working with a specific version, go to the angular project's root folder and check the package.json file to verify which version the project is working with:
"dependencies": {
...
"@angular/cli": "^13.2.2",
... - Under the project's root folder, install cli using the same version:
npm install @angular/cli@13.2.2 - Eventually, check it the project's env:
ng v
It shall return the same version used for the project.
>ENV
Angular
Node.js 16
No comments:
Post a Comment