在ubuntu上装了node.js后,npm install hexo-cli -g 提示没装npm,怎么办

新手上路,请多包涵

在ubuntu上装了node.js后,npm install hexo-cli -g 提示没装npm,怎么办

阅读 4.9k
2 个回答

是不是nodejs 装残了?

你可以通过
npm config get prefix
查看全局安装路径,
通过
npm config set prefix=路径

如果使用apt-get install nodejs npm 需要单独装
官方有安装介绍

NOTE: If you are using Ubuntu Precise or Debian Wheezy, you might want to read about running Node.js >= 4.x on older distros.
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash - sudo apt-get install -y nodejs
Alternatively, for Node.js v6:
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - sudo apt-get install -y nodejs
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题