【问题标题】:why "meteor npm install" is not working on gitpod workspace?为什么“meteor npm install”不能在 gitpod 工作区上运行?
【发布时间】:2020-07-09 23:23:00
【问题描述】:
我是 gitpod.io 的新手,我试图在 gitpod.io 上打开一个流星项目,当我输入“meteor npm install”时,它显示“bash:meteor: command not found”,但是,如果我尝试“npm install”,它工作正常。
请帮我解决这个问题。
【问题讨论】:
标签:
javascript
reactjs
github
meteor
gitpod
【解决方案1】:
原因是meteor没有安装在default workspace Docker image中。
您可以在工作区中运行curl https://install.meteor.com/ | sh。你会收到这样的消息:
Meteor 1.10.2 has been installed in your home directory (~/.meteor).
Writing a launcher script to /usr/local/bin/meteor for your convenience.
This may prompt for your password.
sudo: effective uid is not 0, is /usr/bin/sudo on a file system with the 'nosuid' option set or an NFS file system without root privileges?
Couldn't write the launcher script. Please either:
(1) Run the following as root:
cp "/home/gitpod/.meteor/packages/meteor-tool/1.10.2/mt-os.linux.x86_64/scripts/admin/launch-meteor" /usr/bin/meteor
(2) Add "$HOME/.meteor" to your path, or
(3) Rerun this command to try again.
Then to get started, take a look at 'meteor --help' or see the docs at
docs.meteor.com.
由于您没有root权限,/usr/local/bin/中的脚本无法通过这种方式安装。但是,您仍然可以像这样使用流星:
$ ~/.meteor/meteor
另一种方法是添加您自己的 Dockerfile,如文档中所述:https://www.gitpod.io/docs/config-docker/
这样,你就可以用root权限安装meteor了。