nodejs安装正确,其安装目录是C:\Program Files\nodejs,但是安装grunt时总是出错:
C:\Users\Administrator>npm install -g grunt-cli
Error: Failed to replace env in config: ${APPDATA}
at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:429:13
at String.replace (native)
at envReplace (C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:4
24:12)
at parseField (C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:4
00:7)
at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:338:17
at Array.forEach (native)
at Conf.add (C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:337
:23)
at ConfigChain.addString (C:\Program Files\nodejs\node_modules\npm\node_modu
les\config-chain\index.js:244:8)
at Conf.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\config\cor
e.js:325:10)
at fs.js:334:14
C:\Program Files\nodejs\node_modules\npm\lib\config\core.js文件的429行是:
if (undefined === process.env[name])
throw new Error("Failed to replace env in config: "+orig)
是这里出错了,不知道为什么,有遇到过同样问题的吗?