[Ubuntu]エラー:let notifier = require( 'update-notifier')({pkg})



Error Let Notifier Require



Npmは次のエラーを報告できません。

/usr/local/lib/node_modules/npm/bin/npm-cli.js:79
let notifier = require( 'update-notifier')({pkg})
^^^



SyntaxError:ブロックスコープの宣言(let、const、function、class)は、strictモード以外ではまだサポートされていません
exports.runInThisContext(vm.js:53:16)で
Module._compile(module.js:374:25)で
Object.Module._extensions..js(module.js:417:10)で
Module.load(module.js:344:32)で
Function.Module._load(module.js:301:12)で
Function.Module.runMain(module.js:442:10)で
起動時(node.js:136:18)
node.js:966:3で

最初にnodejsをアンインストールしてから、安定した最新バージョンをインストールします



# apt-get remove nodejs //delete nodejs # curl -sL https://deb.nodesource.com/setup_8.x | sudo bash - //nodejs source # apt-get update //Update package # apt-get install nodejs //Install nodejs # npm install npm -g //Update npm

転載:

著者:ウミワシ
住所: http://blog.51yip.com/jsjquery/1941.html