运行windows 7 Professional 32bit。
我试着在normal或admin下运行npm install -g angular-cli。
我还尝试将它添加到PATH: (C:\Users\Administrator\AppData\Roaming\npm\node_modules\angular-cli\bin\ng)下的环境变量中,也没有成功。
我做错了什么?
运行windows 7 Professional 32bit。
我试着在normal或admin下运行npm install -g angular-cli。
我还尝试将它添加到PATH: (C:\Users\Administrator\AppData\Roaming\npm\node_modules\angular-cli\bin\ng)下的环境变量中,也没有成功。
我做错了什么?
当前回答
我也遵循这个问题,所以我尝试了这个命令,它工作得很好。 使用命令:npm run ng
其他回答
执行以下几行,以解决ng未找到和未定义版本的问题
卸载-g angular-cli
卸载angular-cli
NPM缓存清理
安装-g @angular/cli@latest
我也遵循这个问题,所以我尝试了这个命令,它工作得很好。 使用命令:npm run ng
I was having the same issue when tried with the syntax "ng new " and solved that simply by updating the existing node version from 5.x.x to 8.x.x. After successful updation of node, the syntax worked perfectly for me. Please update the existing version of node. As it is clearly mentioned in angular documentation that these commands require the node version >= 6.9.x. For reference please check https://angular.io/guide/quickstart. It clearly states "Verify that you are running at least node 6.9.x and npm 3.x.x by running node -v and npm -v in a terminal/console window. Older versions produce errors, but newer versions are fine".
通过命令
npm install -g @angular/cli@latest
它工作得很好,我现在能够运行ng命令了。
打开cmd,输入npm install -g @angular/cli 在环境变量中,在用户变量或系统变量中添加“Path”value=C:\Users\your-user\.npm-packages\node_modules\.bin 打开cmd: c:\>cd your-new-project-path ...\project-path\> ng new my-app 或者ng all-ng-commands