Node.js 如何在套管中安装npm

Node.js 如何在套管中安装npm,node.js,gruntjs,requirejs,npm,Node.js,Gruntjs,Requirejs,Npm,我尝试按照说明安装顶针。我成功安装了Bramble,但当我尝试在顶针中安装npm时,显示了以下错误: C:\Users\Askar\Documents\GitHub> cd .\thimble.webmaker.org C:\Users\Askar\Documents\GitHub\thimble.webmaker.org [bramble +1 ~0 -0 !]> npm install | > thimble@2.0.0 postinstall C:\Users\Askar

我尝试按照说明安装顶针。我成功安装了Bramble,但当我尝试在顶针中安装npm时,显示了以下错误:

C:\Users\Askar\Documents\GitHub> cd .\thimble.webmaker.org
C:\Users\Askar\Documents\GitHub\thimble.webmaker.org [bramble +1 ~0 -0 !]> npm install
|
> thimble@2.0.0 postinstall C:\Users\Askar\Documents\GitHub\thimble.webmaker.org

> bower install && node_modules/.bin/grunt requirejs:dist

'node_modules' is not recognized as an internal or external command, operable program or batch file.

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"
npm ERR! node v4.1.0
npm ERR! npm  v2.14.3
npm ERR! code ELIFECYCLE
npm ERR! thimble@2.0.0 postinstall: `bower install && node_modules/.bin/grunt requirejs:dist`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the thimble@2.0.0 postinstall script 'bower install && node_modules/.bin/grunt requirejs:dist'.
npm ERR! This is most likely a problem with the thimble package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     bower install && node_modules/.bin/grunt requirejs:dist
npm ERR! You can get their info via:
npm ERR!     npm owner ls thimble
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\Askar\Documents\GitHub\thimble.webmaker.org\npm-debug.log
C:\Users\Askar\Documents\GitHub\thimble.webmaker.org [bramble +1 ~0 -0 !]>
如何克服此错误?

postInstall脚本存在问题,至少在Windows上失败,因为第一个命令使脚本导航到运行bower命令的文件夹cmd以相同路径运行所有后续命令?。在修复该问题时,您可以自己运行这些命令

npm install //this will fail
"node_modules/.bin/bower" install
"node_modules/.bin/grunt" requirejs:dist
或者,如果您已经在全局范围内安装了bower和grunt npm安装-g bower grunt cli,那么您只需执行以下操作即可

bower install
grunt install
编辑:这已在最新母版中修复