简体   繁体   English

如何在顶针中安装npm

[英]How to install npm in thimble

I try to install thimble following instructions here . 我尝试按照此处的说明安装顶针。 I successfully installed Bramble, but when I try to install npm in thimble, this error is showed: 我成功安装了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 !]>

How can I get through this error? 如何解决此错误?

There's an issue with the postInstall scripts fail (at least on Windows) because the first command makes the script navigate to the folder where the bower command is run (cmd runs all the subsequential commands with the same path?). postInstall脚本存在问题(至少在Windows上如此),因为第一个命令使脚本导航到运行bower命令的文件夹(cmd使用相同路径运行所有后续命令?)。 While that's being fixed, you run the commands yourself 在解决此问题后,您可以自己运行命令

npm install //this will fail
"node_modules/.bin/bower" install
"node_modules/.bin/grunt" requirejs:dist

or if you have installed bower and grunt globally ( npm install -g bower grunt-cli ), you can just do 或者如果您已全局安装了bowergruntnpm install -g bower grunt-cli ),则可以执行

bower install
grunt install

edit: this has now been fixed in the latest master 编辑:这已在最新的母版中修复

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM