angular 项目 npm install 时出现 permission denied 错误
一个 angular 项目运行 npm install 时出现 "permission denied, open '/src/node_modules/.ngcc_lock_file'"错误,请问如何解决?
> ngcc --properties es2015 browser module main --first-only
Error: EACCES: permission denied, open '/src/node_modules/.ngcc_lock_file'
at Object.openSync (node:fs:585:3)
at Module.writeFileSync (node:fs:2153:35)
at NodeJSFileSystem.writeFile (file:///src/node_modules/@angular/compiler-cli/bundles/chunk-CLV7JFJQ.js:357:9)
at LockFileWithChildProcess.write (file:///src/node_modules/@angular/compiler-cli/bundles/chunk-NALI3EFD.js:1721:13)
at AsyncLocker.create (file:///src/node_modules/@angular/compiler-cli/bundles/chunk-NALI3EFD.js:1673:30)
at AsyncLocker.lock (file:///src/node_modules/@angular/compiler-cli/bundles/chunk-NALI3EFD.js:1662:16)
at SingleProcessExecutorAsync.execute (file:///src/node_modules/@angular/compiler-cli/bundles/chunk-NALI3EFD.js:1603:25)
at mainNgcc (file:///src/node_modules/@angular/compiler-cli/bundles/chunk-NALI3EFD.js:2103:19)
at file:///src/node_modules/@angular/compiler-cli/bundles/ngcc/main-ngcc.js:31:11
at file:///src/node_modules/@angular/compiler-cli/bundles/ngcc/main-ngcc.js:41:3
npm ERR! code 1
回答
问题补充:
命令是在容器中运行的,不存在权限问题
THE END
二维码