我尝试按照说明here安装顶针。我成功安装了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 !]>
如何解决此错误?
答案 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 install -g bower grunt-cli
),则可以
bower install
grunt install
编辑:现在已经在最新的主人
中修复了这个问题