2

我不知道在哪里正确标记我的问题,如果我犯了错误,我很抱歉。(我是stackoverflow的新手)。

我正在尝试构建 AWS Greengrass 环境,但在安装必要的软件包时遇到了问题。

我刚刚在虚拟机中将 NodeJS 安装到我的 Ubuntu 20.04.1:

VirtualBox@VirtualBox:~$ sudo apt install nodejs
Reading package lists... Done
Building dependency tree       
Reading state information... Done
nodejs is already the newest version (12.19.0-deb-1nodesource1).
0 upgraded, 0 newly installed, 0 to remove and 243 not upgraded.

VirtualBox@VirtualBox:~$ node --version
v12.19.0

所以,我有 NodeJS。然后我按照这些命令:

cd /greengrass/greengrass-dependency-checker-GGCv1.10.x
wget https://github.com/aws-samples/aws-greengrass-samples/raw/master/greengrass-dependency-checker-GGCv1.10.x.zip
unzip greengrass-dependency-checker-GGCv1.10.x.zip
cd greengrass-dependency-checker-GGCv1.10.x
sudo check_ggc_dependencies | more

现在它显示了这个:

----------------------------Commands and software packages--------------------------
Python 2.7 version: 2.7.18
Python 3.7 version: 3.7.9
NodeJS 12.x: Not found
Java 8: Not found

我不明白,我有 NodeJS,但为什么它说Not found

你对我有什么意见或建议吗?

如果你能回答这个我会很高兴,我花了 3 个小时搜索但仍然无法解决..

4

1 回答 1

1

我解决了它,我想分享我的解决方案;

我按照这里的步骤操作:https ://github.com/aws/aws-greengrass-core-sdk-js

下载 NodeJS:

curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt-get install -y nodejs

After that you find node file under the bin directory.

Copied the file and pasted it to the desktop. The reason is that, we are not able to paste files under the /usr/bin directory, only root is allowed for this.

In the desktop, I changed the name of the file to nodejs12.x

And then opened a terminal in Desktop and run this command:

sudo cp nodejs12.x /usr/bin

The cp command is for giving the root acces. Source: https://askubuntu.com/questions/921797/unable-to-paste-a-file-to-usr-folder

Now, the node file under the bin directory is copied under the /usr/bin directory and named as nodejs12.x. In the end, my problem is solved:

Python 2.7 version: 2.7.18
Python 3.7 version: 3.7.9
NodeJS version: 12.19.1
于 2020-11-16T20:58:16.830 回答