无法创建新的角度项目

时间:2018-03-23 09:30:57

标签: angular

我是角度新手,当我在特定文件夹中运行ng new prj-name命令时,我收到以下错误消息:

错误:

npm ERR!
enoent ENOENT: no such file or directory, 
rename 'Desktop\angular\angular-intro\node_modules\@angular-devkit\build-optimizer\node_modules\typescript' ->
'Desktop\angular\angular-intronode_modules\@angular-devkit\build-optimizer\node_modules\.typescript.DELETE' 
npm ERR! enoent This is related to npm not being able to find a file.

我的计算机上有以下版本的节点和角度:

版本:

C:\Users\lin0x\Desktop\angular>node -v
v9.9.0
C:\Users\lin0x\Desktop\angular>ng -v

    _                      _                 ____ _     ___
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
               |___/

Angular CLI: 1.7.3
Node: 9.9.0
OS: win32 x64
Angular:
...

1 个答案:

答案 0 :(得分:1)

npm install -g @angular/cli

现在将其粘贴到cmd中它应该可以正常工作。您可能无法全局安装

visit here以获得更好的指导。