首页 > 解决方案 > 为什么“meteor npm install”不能在 gitpod 工作区上运行?

问题描述

我是 gitpod.io 的新手,我正在尝试在 gitpod.io 上打开一个流星项目,当我输入“ meteor npm install ”时,它显示“ bash: meteor: command not found ”,但是,如果我尝试“ npm install ” “它工作正常。

请帮我解决这个问题。

标签: javascriptreactjsgithubmeteorgitpod

解决方案


原因是默认工作区meteor中没有安装Docker 映像

您可以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/ 这样,您可以meteor使用 root 权限进行安装。


推荐阅读