admin管理员组文章数量:1192124
I'm running on Windows 7 and have node installed fine with cygwin. I am following along on the how to on mcmahon's website for nodeunit: .
I used npm to install nodeunit and it said it had installed fine but when I go to invoke it, nodeunit, it says command not found in all the different directories.
Do I have to set some kind of path variable maybe?
I'm running on Windows 7 and have node installed fine with cygwin. I am following along on the how to on mcmahon's website for nodeunit: http://caolanmcmahon.com/posts/unit_testing_in_node_js .
I used npm to install nodeunit and it said it had installed fine but when I go to invoke it, nodeunit, it says command not found in all the different directories.
Do I have to set some kind of path variable maybe?
Share Improve this question edited Dec 18, 2011 at 9:53 Gergely Fehérvári 7,9416 gold badges52 silver badges77 bronze badges asked Jun 8, 2011 at 20:12 WildaBeastWildaBeast 4381 gold badge5 silver badges13 bronze badges4 Answers
Reset to default 18In Windows 7
You should install your nodeunit
globally with the -g
flag
npm install nodeunit -g
Check your PATH
by typing the PATH
command in windows console. If you dont find the C:\Users\
Username
\AppData\Roaming\npm;
value, you should check your environment variables, and if not containing, add it manually (replace the Username
to your username).
But I think node installer adds it automatically.
In XP
The AppData\Roaming
folder in Windows Vista or Windows 7 is the same as the Documents and Settings\username\Application Data
folder in Windows XP.
So your variable should look like C:\Documents and Settings\
Username
\Application Data\npm;
Try "npm install -g nodeunit". The -g installs it globally. It's a fairly recent change, so most old documentation doesn't mention it.
Install the node from official windows installer no need to work with cygwin version in windows. The link is http://nodejs.org/dist/v0.10.12/node-v0.10.12-x86.msi .
Open the command prompt as administrator privilege. Press windows key -> type cmd -> press ctr+shift+enter . This will open the command prompt as administrator. Type npm install -g nodeunit . This will make nodeunit available on the prompt.
On Linux you should create a sym link to the binary similar to below (but referencing where your binary is actually installed):
sudo ln -s /opt/node-v4.1.0-linux-x64/bin/nodeunit /usr/local/bin/nodeunit
本文标签: javascriptNodeunit command not foundStack Overflow
版权声明:本文标题:javascript - Nodeunit command not found? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738463401a2088159.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论