Linux 下的node环境的搭建

时间:2021-10-02 01:53:57

目标:在里linux下学习nodejs、JavaScript、vue.js、Less等等(Less在windows下会出许多问题)  

      搭建js运行环境,安装编辑器,搜狗输入法安装等。

1.安装Linux安装Linux就不多说了,今天俺裝的是Linux Mint毕竟不想浪费太多的时间去搞这些配置之类的东西,急着学习js呢.

你可以参考这里安装http://jingyan.baidu.com/article/4d58d5411380dd9dd5e9c07e.html讲的足够详细

2.首先安装搜狗输入法吧!要不心情都没了

默认安装成功后系统是不带中文输入法的,这可急坏啦,搜个东西都没办法打字,在百度上输入sougou还是可以出现搜狗输入法的for Linux,先下载下来再说,

下载后是sogoupinyin_2.1.0.0086_amd64.deb这样的文件夹,试运行一下sudo dpkg -i sogoupinyin_2.1.0.0086_amd64.deb 慢慢等待
Selecting previously unselected package sogoupinyin.
(Reading database ... 195644 files and directories currently installed.)
Preparing to unpack sogoupinyin_2.1.0.0086_amd64.deb ...
Unpacking sogoupinyin (2.1.0.0086) ...
dpkg: dependency problems prevent configuration of sogoupinyin:
sogoupinyin depends on fcitx-frontend-gtk2; however:
Package fcitx-frontend-gtk2 is not installed.
sogoupinyin depends on fcitx-frontend-gtk3; however:
Package fcitx-frontend-gtk3 is not installed.
sogoupinyin depends on fcitx-frontend-qt4; however:
Package fcitx-frontend-qt4 is not installed.
sogoupinyin depends on fcitx-module-kimpanel; however:
Package fcitx-module-kimpanel is not installed.
sogoupinyin depends on libopencc2 | libopencc1; however:
Package libopencc2 is not installed.
Package libopencc1 is not installed.
sogoupinyin depends on fcitx-libs (>= 4.2.7); however:
Package fcitx-libs is not installed.
sogoupinyin depends on fcitx-libs-qt (>= 4.2.7); however:
Package fcitx-libs-qt is not installed.

dpkg: error processing package sogoupinyin (--install):
dependency problems - leaving unconfigured
Processing triggers for libglib2.0-0:amd64 (2.48.2-0ubuntu1) ...
No such key 'Gtk/IMModule' in schema 'org.gnome.settings-daemon.plugins.xsettings' as specified in override file '/usr/share/glib-2.0/schemas/50_sogoupinyin.gschema.override'; ignoring override for this key.
Processing triggers for gnome-menus (3.13.3-6ubuntu3.1) ...
Processing triggers for desktop-file-utils (0.22+linuxmint1) ...
Processing triggers for mime-support (3.59ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.15-0ubuntu1) ...
Processing triggers for shared-mime-info (1.5-2ubuntu0.1) ...
Errors were encountered while processing:
sogoupinyin

一连串的错误看得一脸蒙蔽,大概意思就是安装失败,需要好多依赖项,看了看其他的资料大概需要依赖12项,别慌一条命令搞他(Package fcitx-frontend-gtk2 is not installed.)

sudo apt-get install fcitx libssh2-1 默默等待 嘿嘿 完啦 还出现一样的错误 再来一条命令

sudo apt-get -f install 好啦 选择y 之后等安装完重启就可以啦

3.搭建开发环境

下载vscode,nodejs

配置node开发环境:进入根目录创建app文件夹在app文件夹下创建software文件夹

解压node  $tar -xvf node-v6.11.2-linux-x64.tar.xz  改名 $mv node-v6.11.2-linux-x64 nodejs

在app的software下执行

owen@owen-Inspiron-5537 /app/software $ sudo mv /home/owen/Downloads/nodejs .

owen@owen-Inspiron-5537 /app/software $ sudo ln -s /app/software/nodejs/bin/node /usr/local/bin/node
owen@owen-Inspiron-5537 /app/software $ sudo ln -s /app/software/nodejs/bin/npm /usr/local/bin/npm

检测node -v

v6.11.2

成功