【发布时间】:2018-01-16 14:00:06
【问题描述】:
我是 Angular 2/4 的新手,在我遵循 https://github.com/angular/angular-cli 的命令之前它运行良好。我在我的机器上运行 Angular 2-4。但是在一些 Windows 更新之后,我不再能够运行 Angular。它一直在说
我在 github anugular CLI 安装中运行了以下命令并执行了其他命令
>npm install -g @angular/cli or sometimes I ran npm install -g @angular/cli@latest
npm install
ng serve
当我运行 npm install -g @angular/cli 时。这是下面的消息。
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\@angular\cli\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"
x64"})
npm WARN @schematics/angular@0.1.13 requires a peer of @angular-devkit/schematics@0.0.46 but none was installed.
npm WARN @schematics/schematics@0.0.13 requires a peer of @angular-devkit/schematics@0.0.46 but none was installed.
npm ERR! Windows_NT 6.1.7601
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 v6.10.2
npm ERR! npm v3.10.10
npm ERR! path C:\Users\kislam\AppData\Roaming\npm\node_modules\@angular\cli
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall rename
npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\kislam\AppData\Roaming\npm\node_modules\@angular\cli' -> 'C:\Users\kislam\AppData\Roaming\
npm\node_modules\@angular\.cli.DELETE'
npm ERR! at moveAway (C:\Program Files\nodejs\node_modules\npm\lib\install\action\finalize.js:38:5)
npm ERR! at destStatted (C:\Program Files\nodejs\node_modules\npm\lib\install\action\finalize.js:27:7)
npm ERR! at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:267:18
npm ERR! at FSReqWrap.oncomplete (fs.js:123:15)
npm ERR!
npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\kislam\AppData\Roaming\npm\node_modules\@angular\cli' -> 'C:\Users\kislam\AppData\Roaming\
npm\node_modules\@angular\.cli.DELETE'
npm ERR! at Error (native)
npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\kislam\AppData\Roaming\npm\node_modules\@angular\cli' -> 'C:\Users\kislam\AppData\Roaming
\npm\node_modules\@angular\.cli.DELETE'
npm ERR! at moveAway (C:\Program Files\nodejs\node_modules\npm\lib\install\action\finalize.js:38:5)
npm ERR! at destStatted (C:\Program Files\nodejs\node_modules\npm\lib\install\action\finalize.js:27:7)
npm ERR! at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:267:18
npm ERR! at FSReqWrap.oncomplete (fs.js:123:15)
npm ERR!
npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\kislam\AppData\Roaming\npm\node_modules\@angular\cli' -> 'C:\Users\kislam\AppData\Roaming\
npm\node_modules\@angular\.cli.DELETE'
npm ERR! at Error (native)
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\kislam\Documents\Angular\dynamicform-jan72017\npm-debug.log
npm ERR! code 1
之后我跑了:
npm 安装 服务
我也按照这里的步骤https://github.com/angular/angular-cli
似乎没有任何效果
错误我在运行ng serve时遇到错误
C:\Temp\angular\dynamicformjan72017>ng serve
'ng' is not recognized as an internal or external command,
operable program or batch file.
【问题讨论】:
-
你的 ">npm install -g @angular/cli" 是如何结束的?有没有错误?
-
您对问题缺乏描述的解释过于笼统...尝试向我们提供您的 Angular cli 版本以及您尝试执行的确切步骤...
-
您在哪个版本的节点上运行?
node -v。好像你的安装不成功。也可能是你的 bin 目录被移动了。
标签: angular angular-cli