yarn安装及node升级

ERROR:

root@debian:/home/test/keygen-radio-master/scripts# npm install -g yarn
npm WARN engine yarn@1.9.4: 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
yarn@1.9.4 /usr/local/lib/node_modules/yarn

  

apt-get install npm

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

root@debian:/home/test/keygen-radio-master/scripts# npm install -g n
/usr/local/bin/n -> /usr/local/lib/node_modules/n/bin/n
n@2.1.12 /usr/local/lib/node_modules/n

  


$ n stable

root@debian:/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 cordova@4

npm WARN deprecated npmconf@0.1.16: this package has been reintegrated into npm and is now out of date with respect to npm
npm WARN deprecated node-uuid@1.3.3: Use uuid module instead
npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
npm WARN deprecated graceful-fs@3.0.11: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
npm WARN deprecated minimatch@1.0.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated hoek@0.9.1: The major version is no longer supported. Please update to 4.x or newer
npm WARN deprecated lodash-node@2.4.1: This package is discontinued. Use lodash@^4.0.0.
npm WARN engine pbkdf2@3.0.16: wanted: {"node":">=0.12"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine hash-base@3.0.4: wanted: {"node":">=4"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine hash-base@3.0.4: wanted: {"node":">=4"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine hash-base@3.0.4: wanted: {"node":">=4"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine hash-base@3.0.4: wanted: {"node":">=4"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine hash-base@3.0.4: wanted: {"node":">=4"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine hash-base@3.0.4: wanted: {"node":">=4"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine hash-base@3.0.4: wanted: {"node":">=4"} (current: {"node":"0.10.29","npm":"1.4.21"})
/usr/local/bin/cordova -> /usr/local/lib/node_modules/cordova/bin/cordova
cordova@4.3.1 /usr/local/lib/node_modules/cordova
├── underscore@1.7.0
├── q@1.0.1
├── nopt@3.0.1 (abbrev@1.1.1)
└── cordova-lib@4.3.1 (valid-identifier@0.0.1, osenv@0.1.0, properties-parser@0.2.3, bplist-parser@0.0.6, mime@1.2.11, semver@2.0.11, unorm@1.3.3, shelljs@0.3.0, rc@0.5.2, dep-graph@1.1.0, npmconf@0.1.16, init-package-json@1.10.3, xcode@0.6.7, elementtree@0.1.5, tar@1.0.2, glob@4.0.6, d8@0.4.4, plist@1.1.0, npm@1.3.4, request@2.47.0, through2@0.6.3, cordova-js@3.8.0)

  

也可以指定版本

n 6.9.1

root@debian:/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

原文地址:https://www.cnblogs.com/crac/p/9563469.html