美文网首页
node和npm更新(Windows)

node和npm更新(Windows)

作者: 不知道该取什么名字 | 来源:发表于2019-01-23 09:54 被阅读0次

    一、npm更新

    npm install npm@latest -g  全局更新到最新版本

    网上说可以使用  npm update -g  但是我执行此命令的时候报错

    二、node更新

    当我执行npm install -g n 时发现也有报错,后来才知道,Windows是没有n这个模块的

    就直接去node的官网下载最新的安装包进行下载后更新的

    选择自己对应的版本,然后点击安装,并将安装目录覆盖之前的安装目录,再执行node -v就会发现node是更新后的版本了。

    三、更新node后遇到问题

    之前版本是8.9.3,现在更新之后的版本 是

    之前项目跑起来都是没有问题,下午打包发现,怎么着都跑不起来,简直是要被这个环境给弄死,然后懊恼手贱的自己为什么要更新环境。。。。。总是报下面的错,emmmm~~~ 没谁了

    1.Module build failed: Error: Node Sass does not yet support your current environment 

    2.npm ERR! Failed at the node-sass@4.11.0 postinstall script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above

    一查发现是现在的环境不支持node-sass

    于是,看网上教程

    1) npm install node-sass --save 在我这是没用

    2)npm install node-sass -D 依旧是没用

    3)npm uninstall node-sass  先卸载之前的node-sass 然后再执行 npm install node-sass --save 完美解决

    相关文章

      网友评论

          本文标题:node和npm更新(Windows)

          本文链接:https://www.haomeiwen.com/subject/edtjjqtx.html