您当前的位置: 首页 >  ide
  • 0浏览

    0关注

    1477博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

npm -v /usr/local/lib/node_modules/npm/bin/npm-cli.js:87 not yet supported outside strict mode

软件工程小施同学 发布时间:2020-11-08 18:52:42 ,浏览量:0

root@acme-peer-0:/var/hyperledger/bins# npm -v

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

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode     at exports.runInThisContext (vm.js:53:16)     at Module._compile (module.js:374:25)     at Object.Module._extensions..js (module.js:417:10)     at Module.load (module.js:344:32)     at Function.Module._load (module.js:301:12)     at Function.Module.runMain (module.js:442:10)     at startup (node.js:136:18)     at node.js:966:3

 

原因:nodejs版本太老

解决方法

# 删除nodejs
apt-get remove nodejs

# nodejs源
curl -sL https://deb.nodesource.com/setup_8.x | sudo bash -

# 更新包
apt-get update  

# 安装nodejs
apt-get install nodejs  

# 更新npm
npm install npm -g

 

https://blog.csdn.net/ipfpm/article/details/82999916

 

 

 

关注
打赏
1665320866
查看更多评论
立即登录/注册

微信扫码登录

1.6907s