我正在google中搜索有关如何显示Node js版本或如何与npm一起使用的信息? 如果我这样做
I'm searching it in google on how to show the version of node js or how I'm gonna work with npm? If I do this
npm -v即使我已经使用brew install node安装了它.结果总是
even I already install it using brew install node. The result is always
env: node: No such file or directory我已经做了很多命令来解决它,但是失败了. 这些是我已经尝试过的命令:
I already do a lot of command to solve for it, but failed. these are the command that I already try:
sudo apt-get install nodejs-legacy sudo ln -s /usr/local/bin/node /usr/bin/node brew unlink node brew link node因此,我无法启动任务.帮帮我在使用此命令brew link --overwrite node之后,这项工作才开始.现在我有问题,我不能再使用npm了.我真的很新.我现在对如何解决这个问题一无所知.
I can't start the task because of this. help me guys. This work before after I used this command brew link --overwrite node. Now I have problem, i cant work anymore with npm. I'm really new about this. I don't have any idea now on how to fix this.
更新
我已经使用npm list命令获得了列表.我也在这里链接,但是当我npm install在项目内部时.我总是得到这个结果环境:节点:没有这样的文件或目录",即使我命令npm -v,但是如果我在我的项目之外命令它的话.它可以运行npm -v
I already get the list using npm list command. I also get the idea here link but when I npm install inside the project. I alwayst get this "result env: node: No such file or directory",even I command npm -v but If i command it outside my project. It work the npm -v
推荐答案注意:仅Mac用户!
curl -ksO gist.githubusercontent/nicerobot/2697848/raw/uninstall-node.sh chmod +x ./uninstall-node.sh ./uninstall-node.sh rm uninstall-node.sh
或者您可以访问以下网站:如何完全卸载Node.js,然后从头开始重新安装(Mac OS X)
Or you could check out this website: How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)
如果这不起作用,则需要通过控制面板或任何其他方法删除节点.只要将其移除.
if this doesn't work, you need to remove node via control panel or any other method. As long as it gets removed.
如果使用nvm,则可以使用:
If you use nvm, you can use:
nvm install node
您已经可以检查它是否有效,那么您无需执行以下步骤:npm -v然后node -v
You can already check if it works, then you don't need to take the following steps with: npm -v and then node -v
如果已安装nvm: command -v nvm
sudo npm uninstall npm -g
或者,如果失败,则获取npm源代码,然后执行以下操作:
Or, if that fails, get the npm source code, and do:
sudo make uninstall
如果已安装nvm,请使用:nvm uninstall npm
If you have nvm installed, then use: nvm uninstall npm
更多推荐
env:节点:mac中没有这样的文件或目录
发布评论