问题描述: 在使用Angular CLI 7创建新项目时,可能会遇到以下错误:
Error: Refusing to delete C:\path\to\project\node_modules\.cache\angular-cli\7.0.0 because it resolves to the same directory as C:\path\to\project\node_modules\@angular\cli. This module is not listed in the project's package.json.dependencies
解决方法:
这个问题是由于CircularJSON
模块导致的,可以通过以下步骤解决:
打开命令行,并切换到项目的根目录。
运行以下命令来删除node_modules
文件夹:
rm -rf node_modules
npm cache clean --force
npm install
希望这个解决方法可以帮助你解决问题!