当Angular应用程序无法在angular.json脚本中找到一个依赖项时,可以尝试以下解决方法:
npm install
该命令将会根据package.json文件安装所有依赖项。
npm ls
请将
替换为要查找的依赖项名称。如果依赖项未安装,则需要运行npm install
命令安装它。
"scripts": [
"node_modules/jquery/dist/jquery.min.js"
]
import * as $ from 'jquery';
npm install @types/jquery
如果以上步骤都没有解决问题,可能需要检查依赖项的版本兼容性或查找其他可能的问题所在。