Package.json - 无法安装模块

3gw*_*ain 0 json node.js npm gruntjs

我有一个空文件夹,我在其中创建了一个package.json文件,其中包含:

{
    "name":"sample project",
    "version":"0.0.1",
    "title":"My grunt App",
    "homepage":"http://gruntjs.com"
}
Run Code Online (Sandbox Code Playgroud)

稍后在同一个文件夹中,我试图运行此命令:

npm install grunt --save-dev

但我得到这样的错误:根本无法安装grunt

D:\grunt2>npm install grunt --save-dev
npm ERR! Error: Invalid name: "sample project"
npm ERR!     at ensureValidName (C:\Program Files (x86)\nodejs\node_modules\npm\
node_modules\read-package-json\node_modules\normalize-package-data\lib\fixer.js:
300:15)
npm ERR!     at Object.module.exports.fixNameField (C:\Program Files (x86)\nodej
s\node_modules\npm\node_modules\read-package-json\node_modules\normalize-package
-data\lib\fixer.js:204:5)
npm ERR!     at C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\read
-package-json\node_modules\normalize-package-data\lib\normalize.js:30:38
npm ERR!     at Array.forEach (native)
npm ERR!     at normalize (C:\Program Files (x86)\nodejs\node_modules\npm\node_m
odules\read-package-json\node_modules\normalize-package-data\lib\normalize.js:29
:15)
npm ERR!     at final (C:\Program Files (x86)\nodejs\node_modules\npm\node_modul
es\read-package-json\read-json.js:342:33)
npm ERR!     at then (C:\Program Files (x86)\nodejs\node_modules\npm\node_module
s\read-package-json\read-json.js:126:33)
npm ERR!     at C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\read
-package-json\read-json.js:316:48
npm ERR!     at fs.js:207:20
npm ERR!     at OpenReq.Req.done (C:\Program Files (x86)\nodejs\node_modules\npm
\node_modules\graceful-fs\graceful-fs.js:144:5)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program File
s (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "grunt" "--save-d
ev"
npm ERR! cwd D:\grunt2
npm ERR! node -v v0.10.28
npm ERR! npm -v 1.4.9
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     D:\grunt2\npm-debug.log
npm ERR! not ok code 0
Run Code Online (Sandbox Code Playgroud)

无法理解这个问题.有人帮帮我吗?其实我正在尝试重现本教程:http://www.anujgakhar.com/2013/02/28/writing-a-simple-grunt-task-using-gruntjs/

Nit*_*ked 6

不要在项目名称中使用空格.改变,例如,改为sample-project.(这是非常错误的第一线,顺便说一句:Error: Invalid name: "sample project")