C:\Windows\system32> C:\Windows\system32>ng version internal/modules/cjs/loader.js:983 throw err; ^ Error: Cannot find module 'C:\Program Files\nodejs\node_modules\angular-cli\
时间: 2023-06-30 07:19:26 浏览: 159
It looks like there is an error with the module path. You can try the following steps to resolve the issue:
1. First, make sure that you have installed the latest version of Node.js and npm.
2. Then, uninstall the Angular CLI by running the following command in the Command Prompt:
```
npm uninstall -g @angular/cli
```
3. After that, clear the npm cache by running the following command:
```
npm cache clean --force
```
4. Finally, reinstall the Angular CLI by running the following command:
```
npm install -g @angular/cli
```
Once the installation is complete, try running the "ng version" command again in the Command Prompt and see if it works. If you still encounter the same error, you may need to check your system's environment variables to ensure that the path to the Angular CLI executable is properly set.
阅读全文