Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/42.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/symfony/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 在Windows上通过npm安装grunt cli包失败_Node.js_Windows_Gruntjs_Npm - Fatal编程技术网

Node.js 在Windows上通过npm安装grunt cli包失败

Node.js 在Windows上通过npm安装grunt cli包失败,node.js,windows,gruntjs,npm,Node.js,Windows,Gruntjs,Npm,我无法在windows 7上安装grunt 我正试图通过以下命令安装它: npm install ‐g grunt‐cli 但它给了我以下错误: C:\Windows\System32>npm install -g grunt-cli npm ERR! addLocal Could not install C:\Windows\System32\-g npm ERR! addLocal Could not install C:\Windows\System32\grunt-cli npm

我无法在windows 7上安装grunt

我正试图通过以下命令安装它:

npm install ‐g grunt‐cli
但它给了我以下错误:

C:\Windows\System32>npm install -g grunt-cli
npm ERR! addLocal Could not install C:\Windows\System32\-g
npm ERR! addLocal Could not install C:\Windows\System32\grunt-cli
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" "grunt-cli"
npm ERR! node v0.12.5
npm ERR! npm  v2.11.2
npm ERR! path C:\Windows\System32\-g
npm ERR! code ENOENT
npm ERR! errno -4058

npm ERR! enoent ENOENT, open 'C:\Windows\System32\-g'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Windows\System32\npm-debug.log

将参数的顺序更改为:

npm install ‐g grunt‐cli


干杯

我想您需要更改文件夹。我不会在C:\Windows\System32\下安装程序包。它似乎试图将
-g
标志视为要安装的程序包。你能确认你正在使用一个标准的破折号字符作为标志吗?您是否可以尝试对
npm安装--global grunt cli
执行相同的操作?
npm install grunt-cli -g