将bootstrap添加到angular-cli项目时出错

时间:2018-08-18 11:56:14

标签: angular angular-cli angular-ui-bootstrap

使用angular-cli将引导程序添加到角度项目中时遇到此错误

npm install bootstrap@3 jquery --save
npm ERR! path C:\Users\cw\Desktop\Basic-angular\got\node_modules\.staging
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall unlink
npm ERR! Error: EPERM: operation not permitted, unlink 'C:\Users\cw\Desktop\Basic-angular\got\node_modules\.staging'
npm ERR!  { Error: EPERM: operation not permitted, unlink 'C:\Users\cw\Desktop\Basic-angular\got\node_modules\.staging'
npm ERR!   stack: 'Error: EPERM: operation not permitted, unlink \'C:\\Users\\cw\\Desktop\\Basic-angular\\got\\node_modules\\.staging\'',
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'unlink',
npm ERR!   path: 'C:\\Users\\cw\\Desktop\\Basic-angular\\got\\node_modules\\.staging' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\cw\AppData\Roaming\npm-cache\_logs\2018-08-18T11_54_33_403Z-debug.log

1 个答案:

答案 0 :(得分:1)

错误消息显示“以管理员身份运行此命令”。如果您使用的是cmd,请尝试以管理员身份运行cmd。