我正在尝试在Windows7 64位环境下使用最新版本的npm(5.3.0)和节点(v8.2.1)安装angular-cli。 npm和节点按预期工作。
但是当我尝试使用命令安装angular-cli时:
npm install -g @angular/cli
将所有必需文件复制到appdata / Raoming / npm文件夹后失败。下面是错误堆栈跟踪:
11902 verbose stack Error: EPERM: operation not permitted, rename 'C:\Users\agamull\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\webpack-dev-server\node_modules\string-width\package.json.1854123090' -> 'C:\Users\agamull\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\webpack-dev-server\node_modules\string-width\package.json'
11903 verbose cwd C:\Windows\system32
11904 verbose Windows_NT 6.1.7601
11905 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "@angular/cli"
11906 verbose node v8.2.1
11907 verbose npm v5.3.0
11908 error path C:\Users\agamull\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\webpack-dev-server\node_modules\string-width\package.json.1854123090
11909 error code EPERM
11910 error errno -4048
11911 error syscall rename
11912 error Error: EPERM: operation not permitted, rename 'C:\Users\agamull\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\webpack-dev-server\node_modules\string-width\package.json.1854123090' -> 'C:\Users\agamull\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\webpack-dev-server\node_modules\string-width\package.json'
11912 error { Error: EPERM: operation not permitted, rename 'C:\Users\agamull\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\webpack-dev-server\node_modules\string-width\package.json.1854123090' -> 'C:\Users\agamull\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\webpack-dev-server\node_modules\string-width\package.json'
11912 error cause:
11912 error { Error: EPERM: operation not permitted, rename 'C:\Users\agamull\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\webpack-dev-server\node_modules\string-width\package.json.1854123090' -> 'C:\Users\agamull\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\webpack-dev-server\node_modules\string-width\package.json'
11912 error errno: -4048,
11912 error code: 'EPERM',
11912 error syscall: 'rename',
11912 error path: 'C:\\Users\\agamull\\AppData\\Roaming\\npm\\node_modules\\@angular\\cli\\node_modules\\webpack-dev-server\\node_modules\\string-width\\package.json.1854123090',
11912 error dest: 'C:\\Users\\agamull\\AppData\\Roaming\\npm\\node_modules\\@angular\\cli\\node_modules\\webpack-dev-server\\node_modules\\string-width\\package.json' },
11912 error stack: 'Error: EPERM: operation not permitted, rename \'C:\\Users\\agamull\\AppData\\Roaming\\npm\\node_modules\\@angular\\cli\\node_modules\\webpack-dev-server\\node_modules\\string-width\\package.json.1854123090\' -> \'C:\\Users\\agamull\\AppData\\Roaming\\npm\\node_modules\\@angular\\cli\\node_modules\\webpack-dev-server\\node_modules\\string-width\\package.json\'',
11912 error errno: -4048,
11912 error code: 'EPERM',
11912 error syscall: 'rename',
11912 error path: 'C:\\Users\\agamull\\AppData\\Roaming\\npm\\node_modules\\@angular\\cli\\node_modules\\webpack-dev-server\\node_modules\\string-width\\package.json.1854123090',
11912 error dest: 'C:\\Users\\agamull\\AppData\\Roaming\\npm\\node_modules\\@angular\\cli\\node_modules\\webpack-dev-server\\node_modules\\string-width\\package.json',
11912 error parent: 'webpack-dev-server' }
11913 error Please try running this command again as root/Administrator.
11914 verbose exit [ -4048, true ]
注意:我在我的MAC OS上成功安装了它。我尝试卸载npm和节点,再次重新安装并再次尝试,但没有工作。我在我正在处理的计算机上拥有管理员权限。尝试以管理员身份运行命令提示符。
答案 0 :(得分:1)
您可能需要使用Node6以获得32位支持。