安装Angular 4 cli时出现以下错误。
错误:
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\User>node -v
v8.9.4
C:\Users\User>npm -v
3.3.8
C:\Users\User>npm install -g @angular/cli
npm ERR! Windows_NT 6.1.7600
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\User\\AppData\\R
oaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "@angular/cli"
npm ERR! node v8.9.4
npm ERR! npm v3.3.8
npm ERR! code MODULE_NOT_FOUND
npm ERR! Cannot find module 'internal/util/types'
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\User\npm-debug.log
C:\Users\User>
我已在Windows 7计算机上安装了Node版本8.9.4,在安装时我收到此错误。
答案 0 :(得分:0)
升级npm模块
npm i -g npm
else =&gt;最好使用v6
安装nvm [node version manager]
nvm install v6.11.4
nvm use v6.11.4
nvm default v6.11.4
npm i -g npm
然后安装
npm install -g @angular/cli
答案 1 :(得分:0)
尝试清除npm npm cache clean --force 并安装它。