angular - Angular 9 ngcc 尝试扫描整个磁盘
问题描述
我按照 angular.io 指南将 Angular 8 迁移到 Angular 9,但是在生成 ivy 入口点时遇到了问题。
当我这样做时,我在命令执行npm install
期间看到以下错误。ngcc
ngcc
Error: EPERM: operation not permitted, lstat 'E:/System Volume Information'
at Object.lstatSync (fs.js:917:3)
我使用的是 Windows 10 和 Node 12,但我在 macOS 上尝试过,我得到了相同的结果(当然是在另一个系统保护路径上)。
按照我的安装后脚本
"postinstall": "ngcc --properties es2015 browser module main --first-only --create-ivy-entry-points"
我搜索了这个问题并提出了解决方案来更改文件夹权限,但我不想让我的操作系统不安全。
如果没有 ngcc 工作,我也不能做 ng 服务。
如何防止 ngcc 扫描整个磁盘并且只做它应该做的事情?是否有任何已知的错误?
编辑 :
tsconfig.json
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"module": "esnext",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"importHelpers": true,
"target": "es2015",
"typeRoots": ["node_modules/@types"],
"lib": ["es2018", "dom"],
"paths": {
"@app/*": ["src/app/*"],
"@src/*": ["src/*"],
"@root/*": ["/*"]
}
}
}
解决方案
问题出在 tsconfig.js
{
...
"paths": {
"@app/*": ["src/app/*"],
"@src/*": ["src/*"],
"@root/*": ["/*"]
}
...
}
我希望@root 路径仅针对项目的根目录,但我忘记了使它相对的点
"@root/*": ["./*"]
推荐阅读
- sympy - SymPy:打印出函数时如何减少替换深度
- python - 在 Flask Web 应用程序中创建用户对象的位置
- php - 如何在php中回显包含html的变量
- c# - 如何将实例数据复制到/覆盖现有的类引用?C#
- android - 如何在android中创建socket.io服务
- javascript - 无法在 html5 画布上绘图
- windows - 如何隐藏 VSCode 标题栏
- django - Django heroku连接读写主键问题
- apache-spark - Spark ClassNotFoundException:找不到数据源 kinesis
- r - 我想在火山图中显示前 10 个上调和下调的基因