yarn安装及node升级

Posted crac

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了yarn安装及node升级相关的知识,希望对你有一定的参考价值。

ERROR:

 

[email protected]:/home/test/keygen-radio-master/scripts# npm install -g yarn
npm WARN engine [email protected]: wanted: {"node":">=4.0.0"} (current: {"node":"0.10.29","npm":"1.4.21"})
/usr/local/bin/yarn -> /usr/local/lib/node_modules/yarn/bin/yarn.js
/usr/local/bin/yarnpkg -> /usr/local/lib/node_modules/yarn/bin/yarn.js
[email protected] /usr/local/lib/node_modules/yarn

  

 

apt-get install npm

建议先装n,再用n把node升级到最新稳定版
$ npm install -g n

[email protected]:/home/test/keygen-radio-master/scripts# npm install -g n
/usr/local/bin/n -> /usr/local/lib/node_modules/n/bin/n
[email protected] /usr/local/lib/node_modules/n

  


$ n stable

[email protected]:/home/test/keygen-radio-master/scripts# n stable

     install : node-v10.8.0
       mkdir : /usr/local/n/versions/node/10.8.0
       fetch : https://nodejs.org/dist/v10.8.0/node-v10.8.0-linux-x64.tar.gz
######################################################################## 100.0%
   installed : v10.8.0

 

npm install -g [email protected]

npm WARN deprecated [email protected]: this package has been reintegrated into npm and is now out of date with respect to npm
npm WARN deprecated [email protected]: Use uuid module instead
npm WARN deprecated [email protected]: Use uuid module instead
npm WARN deprecated [email protected]: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: The major version is no longer supported. Please update to 4.x or newer
npm WARN deprecated [email protected]: This package is discontinued. Use [email protected]^4.0.0.
npm WARN engine [email protected]: wanted: {"node":">=0.12"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine [email protected]: wanted: {"node":">=4"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine [email protected]: wanted: {"node":">=4"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine [email protected]: wanted: {"node":">=4"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine [email protected]: wanted: {"node":">=4"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine [email protected]: wanted: {"node":">=4"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine [email protected]: wanted: {"node":">=4"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine [email protected]: wanted: {"node":">=4"} (current: {"node":"0.10.29","npm":"1.4.21"})
/usr/local/bin/cordova -> /usr/local/lib/node_modules/cordova/bin/cordova
[email protected] /usr/local/lib/node_modules/cordova
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])

  

也可以指定版本

n 6.9.1

 

[email protected]:/home/test/keygen-radio-master/scripts# n 6.9.1

     install : node-v6.9.1
       mkdir : /usr/local/n/versions/node/6.9.1
       fetch : https://nodejs.org/dist/v6.9.1/node-v6.9.1-linux-x64.tar.gz
######################################################################## 100.0%
   installed : v6.9.1

 

需要重启,重启后:

npm install -g yarn

yarn build

yarn start

 



以上是关于yarn安装及node升级的主要内容,如果未能解决你的问题,请参考以下文章

mac 下node,yarn安装及版本切换

linux (centos)安装卸载升级node, npm, yarn

升级Yarn 2,摆脱node_modules

安装js包管理工具(node.jsyarm)及代码编辑工具(vs code)

升级Yarn 2,大规模瘦身node_modules

Centos安装yarn