【发布时间】:2020-05-25 10:52:04
【问题描述】:
我按照 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 serve。
如何防止 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.json、tsconfig.app.json和angular.json文件吗?那里的设置路径可能有问题 -
非常感谢,问题出在 tsconfig.json
标签: angular npm-install angular-ivy