安装 angular-cli 时出错
Errors when installing angular-cli
我有最新版本的节点和 npm:
> npm -v
3.10.8
> node -v
v4.6.1
安装时得到这个angular-cli
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\Misha\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "install" "-g" "angular-cli"
npm ERR! node v4.6.1
npm ERR! npm v3.10.8
npm ERR! path C:\Users\Misha\AppData\Roaming\npm\node_modules\.staging\abbrev-9f02c1d4
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\Mishap\AppData\Roaming\npm\node_modules\.staging\abbrev-9f02c1d4' -> 'C:\Users\Mishap\AppData\Roaming\npm\node_modules\angular-cli\node_modules\npm\node_modules\abbrev'
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\Mishap\AppData\Roaming\npm\node_modules\.staging\abbrev-9f02c1d4' -> 'C:\Users\Mishap\AppData\Roaming\npm\node_modules\angular-cli\node_modules\npm\node_modules\abbrev'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
有什么想法吗?
首先卸载软件包解决了问题:
npm uninstall -g angular-cli
npm install -g angular-cli
更新您的节点,然后 运行 以管理员身份进入命令提示符并试试这个:
npm install -g angular-cli@1.0.0-beta.18
我已经按照这些步骤解决了这些错误。
- 第一步也是最重要的一步,在管理员模式下打开命令提示符。原因,为什么我说这很重要,因为有时读写文件通常会由于系统中可用的文件读写权限而中止。
如果你已经安装了一些@angular/cli,那么卸载它,
npm uninstall -g angular-cli
清理 npm 缓存为
npm cache clean
然后尝试安装为
npm install -g @angular/cli@latest
我有最新版本的节点和 npm:
> npm -v
3.10.8
> node -v
v4.6.1
安装时得到这个angular-cli
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\Misha\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "install" "-g" "angular-cli"
npm ERR! node v4.6.1
npm ERR! npm v3.10.8
npm ERR! path C:\Users\Misha\AppData\Roaming\npm\node_modules\.staging\abbrev-9f02c1d4
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\Mishap\AppData\Roaming\npm\node_modules\.staging\abbrev-9f02c1d4' -> 'C:\Users\Mishap\AppData\Roaming\npm\node_modules\angular-cli\node_modules\npm\node_modules\abbrev'
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\Mishap\AppData\Roaming\npm\node_modules\.staging\abbrev-9f02c1d4' -> 'C:\Users\Mishap\AppData\Roaming\npm\node_modules\angular-cli\node_modules\npm\node_modules\abbrev'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
有什么想法吗?
首先卸载软件包解决了问题:
npm uninstall -g angular-cli
npm install -g angular-cli
更新您的节点,然后 运行 以管理员身份进入命令提示符并试试这个:
npm install -g angular-cli@1.0.0-beta.18
我已经按照这些步骤解决了这些错误。
- 第一步也是最重要的一步,在管理员模式下打开命令提示符。原因,为什么我说这很重要,因为有时读写文件通常会由于系统中可用的文件读写权限而中止。
如果你已经安装了一些@angular/cli,那么卸载它,
npm uninstall -g angular-cli
清理 npm 缓存为
npm cache clean
然后尝试安装为
npm install -g @angular/cli@latest