超级简单
$ yum -y install nodejs
 
验证安装
安装node.js 会自动一起安装npm
 注意,python -V,是大写字母V,错写为小写会进入python的编辑模式 ,执行exit()退出
 
- 执行
node,启动node终端,两次Ctrl+C退出,或者执行.exit退出 - 由于打印语句无返回值,所以会有一个 undefined
![在这里插入图片描述]()
 
NPM
参考https://www.runoob.com/nodejs/nodejs-npm.html
安装/卸载
本地安装: $ npm install 模块名
 全局安装: $ npm install 模块名 -g
 卸载: $ npm uninstall 模块名
 查看包: $ npm ls
查看安装的所有模块
查看全局安装的所有模块 : $ npm list -g
更新
$ npm update 模块名
搜索
$ npm search 模块名
淘宝镜像
https://npmmirror.com/
 $ npm install -g cnpm --registry=https://registry.npmmirror.com
 太慢了不知道为啥
                    
                
                
            
        
浙公网安备 33010602011771号