首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Angular-cli不会更新

Angular-cli不会更新
EN

Stack Overflow用户
提问于 2016-10-05 16:30:26
回答 2查看 417关注 0票数 0

我需要将我的angular-cli更新到最新版本。当我运行时:

代码语言:javascript
复制
npm cache clean

我面临以下错误:

代码语言:javascript
复制
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "cache" "clean"
npm ERR! node v4.4.0
npm ERR! npm  v2.14.20
npm ERR! path C:\Users\Salman\AppData\Roaming\npm-cache
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall rmdir

npm ERR! Error: EPERM: operation not permitted, rmdir 'C:\Users\Salman\AppData\Roaming\npm-cache'
npm ERR!     at Error (native)
npm ERR!  { [Error: EPERM: operation not permitted, rmdir 'C:\Users\Salman\AppData\Roaming\npm-cache']
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'rmdir',
npm ERR!   path: 'C:\\Users\\Salman\\AppData\\Roaming\\npm-cache' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\Salman\Desktop\Nuroscience\dep1\npm-debug.log

另外,当我继续执行安装命令时:

代码语言:javascript
复制
npm install -g angular-cli@latest

我面对这样的错误:

代码语言:javascript
复制
npm WARN peerDependencies The peer dependency webpack@* included from html-webpack-plugin will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN deprecated lodash.assign@4.2.0: This package is deprecated. Use Object.assign.
npm WARN deprecated graceful-fs@1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated tough-cookie@2.2.2: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130

> execSync@1.0.2 install C:\Users\Salman\AppData\Roaming\npm\node_modules\angular-cli\node_modules\angular2-template-loader\node_modules\codecov\node_modules\execSync
> node install.js

[execsync v1.0.2] Attempting to compile native extensions.
{ [Error: spawn node-gyp ENOENT]
  code: 'ENOENT',
  errno: 'ENOENT',
  syscall: 'spawn node-gyp',
  path: 'node-gyp',
  spawnargs: [ 'rebuild' ] }
[execSync v1.0.2]
    Native code compile failed!!
    Will try to use win32 extension.
npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN optional dep failed, continuing fsevents@1.0.14

> node-zopfli@2.0.1 install C:\Users\Salman\AppData\Roaming\npm\node_modules\angular-cli\node_modules\compression-webpack-plugin\node_modules\node-zopfli
> node-pre-gyp install --fallback-to-build

[node-zopfli] Success: "C:\Users\Salman\AppData\Roaming\npm\node_modules\angular-cli\node_modules\compression-webpack-plugin\node_modules\node-zopfli\lib\binding\node-v46-win32-x64\zopfli.node" is installed via remote
npm WARN deprecated lodash-node@2.4.1: This package is discontinued. Use lodash@^4.0.0.

> node-sass@3.10.1 install C:\Users\Salman\AppData\Roaming\npm\node_modules\angular-cli\node_modules\node-sass
> node scripts/install.js

Start downloading binary at https://github.com/sass/node-sass/releases/download/v3.10.1/win32-x64-46_binding.node
Binary downloaded and installed at C:\Users\Salman\AppData\Roaming\npm\node_modules\angular-cli\node_modules\node-sass\vendor\win32-x64-46\binding.node

> node-sass@3.10.1 postinstall C:\Users\Salman\AppData\Roaming\npm\node_modules\angular-cli\node_modules\node-sass
> node scripts/build.js

"C:\Users\Salman\AppData\Roaming\npm\node_modules\angular-cli\node_modules\node-sass\vendor\win32-x64-46\binding.node" exists.
 testing binary.
Binary is fine; exiting.
C:\Users\Salman\AppData\Roaming\npm\ng -> C:\Users\Salman\AppData\Roaming\npm\node_modules\angular-cli\bin\ng
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "angular-cli@latest"
npm ERR! node v4.4.0
npm ERR! npm  v2.14.20
npm ERR! code EPEERINVALID

npm ERR! peerinvalid The package webpack@2.1.0-beta.22 does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer html-webpack-plugin@2.22.0 wants webpack@*
npm ERR! peerinvalid Peer karma-webpack@1.8.0 wants webpack@^1.1.0 || ^2 || ^2.1.0-beta
npm ERR! peerinvalid Peer sass-loader@3.2.3 wants webpack@^1.12.6 || ^2.1.0-beta
npm ERR! peerinvalid Peer string-replace-loader@1.0.5 wants webpack@1 || 2 || ^2.0.0-beta || ^2.1.0-beta
npm ERR! peerinvalid Peer webpack-dev-server@2.1.0-beta.3 wants webpack@^2.1.0-beta

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\Salman\Desktop\Nuroscience\dep1\npm-debug.log

那么,这个错误是什么,以及我如何修复它?

EN

回答 2

Stack Overflow用户

发布于 2016-10-05 16:50:38

https://github.com/angular/angular-cli#updating-angular-cli

要将angular-cli更新到新版本,您必须同时更新全局包和项目的本地包,请单击链接

代码片段:

代码语言:javascript
复制
npm uninstall -g angular-cli
npm cache clean
npm install -g angular-cli@latest

注意:始终以管理员身份运行命令提示符,有时您必须多次运行npm cache clean,直到错误消失

票数 -2
EN

Stack Overflow用户

发布于 2016-10-05 16:42:00

您应该以允许清除缓存的管理员身份运行cmd。一旦npm cache clean完成,你就可以成功安装angular cli了。

票数 -3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39868992

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档