node.js - 以角度创建新项目时出错
问题描述
我正在尝试使用命令创建新的角度项目ng new my-app
。下面列出了已安装的版本
- 角 CLI:6.0
- 节点版本:10.5.0
- Npm:6.1.0
我收到以下错误消息,
ERR! path D:\ng\newapp\node_modules\.staging\typescript-4c0ca0e6\lib\lib.dom.d.ts
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall unlink
npm ERR! Error: EPERM: operation not permitted, unlink 'D:\ng\newapp\node_modules\.staging\typescript-4c0ca0e6\lib\lib.dom.d.ts'
npm ERR! { [Error: EPERM: operation not permitted, unlink 'D:\ng\newapp\node_modules\.staging\typescript-4c0ca0e6\lib\lib.dom.d.ts']
npm ERR! cause:
npm ERR! { Error: EPERM: operation not permitted, unlink 'D:\ng\newapp\node_modules\.staging\typescript-4c0ca0e6\lib\lib.dom.d.ts'
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'unlink',
npm ERR! path:
npm ERR! 'D:\\ng\\newapp\\node_modules\\.staging\\typescript-4c0ca0e6\\lib\\lib.dom.d.ts' },
npm ERR! stack:
npm ERR! 'Error: EPERM: operation not permitted, unlink \'D:\\ng\\newapp\\node_modules\\.staging\\typescript-4c0ca0e6\\lib\\lib.dom.d.ts\'',
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'unlink',
npm ERR! path:
npm ERR! 'D:\\ng\\newapp\\node_modules\\.staging\\typescript-4c0ca0e6\\lib\\lib.dom.d.ts',
npm ERR! parent: '@angular-devkit/build-optimizer' }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).
解决方案
临时修复,将 npm 降级到 5.3
npm install npm@5.3 -g
推荐阅读
- oracle - Oracle JDBC Resultset.getString("COLUMN_DEF") 返回小写引号字符串
- configuration - 在 kube-apiserver 中设置功能门 RuntimeClass
- reactjs - 如何从我的示例中使 React 组件看起来更具可读性和简洁性?
- excel - Excel:计算员工一周内一起工作的频率?
- regex - 正则表达式:文件名中的否定模式
- java - 从 MYSQL 获取基于用户 ID 的数据并显示在 android studio 的 recyclerview 中
- java - 需要一个找不到的“org.springframework.mail.javamail.JavaMailSender”类型的bean,但给出了配置
- php - 显示没有 css 和 js 的索引页面
- android - Android App Link verify 一直不起作用
- php - 哪一个是最好和更快的方法?(制作下拉方法)