运行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)下的环境变量中,也没有成功。
我做错了什么?
当前回答
只需打开命令提示符(以管理员身份运行)。确保node——v高于6.9.0,npm——v高于3.0.0 r。
然后执行以下命令:
npm install -g @angular/cli
一旦安装了angular。你可以在路径中看到angular cli的条目
C:\Users\Dell\AppData\Roaming\npm\node_modules\@angular
那就试着帮忙。它会起作用的。
其他回答
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".
我在Windows 7上也遇到了同样的问题,64位运行npm v3.10.8。
我按照建议添加了路径:(C:\Users.....(你的用户名)\AppData\Roaming\npm\node_modules\angular-cli\bin\ng)和卸载angular-cli。 在这之后,我清除npm缓存通过npm缓存清理提示这里https://blogs.msdn.microsoft.com/matt-harrington/2012/02/23/how-to-fix-node-js-npm-permission-problems/。这保证了没有剩菜。 用npm install -g angular-cli重新安装angular-cli,瞧。 希望对大家有用!
尝试使用%AppData%\npm\设置系统变量路径。确保AppData文件夹的可见性。这个文件夹应该是可见的(而不是隐藏的)。
在尝试更新Windows 7 (x64)上的PATH变量之前,运行CMD控制台AS ADMINISTRATOR和ng命令对我有用,这也适用于VISUAL STUDIO CODE控制台。
它为我工作在CMD控制台/ VS CODE
只需打开命令提示符(以管理员身份运行)。确保node——v高于6.9.0,npm——v高于3.0.0 r。
然后执行以下命令:
npm install -g @angular/cli
一旦安装了angular。你可以在路径中看到angular cli的条目
C:\Users\Dell\AppData\Roaming\npm\node_modules\@angular
那就试着帮忙。它会起作用的。