CNPM 遇到use strict的问题
一、问题描述
[root@VM_123_144_centos node01]# cnpm install --save nodemailer
/usr/lib/node_modules/cnpm/node_modules/npminstall/bin/install.js:5
const debug = require('debug')('npminstall:bin:install');
^^^^^
SyntaxError: Use of const in strict mode.
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:929:3
二、解决办法
删除node_modules文件夹
[root@VM_123_144_centos node01]# rm -rf /usr/lib/node_modules
使用NVM重新安装最新版的nodejs
nvm install node
安装成功后,查看版本
[root@VM_123_144_centos node01]# nvm install node
v6.4.0 is already installed.
Now using node v6.4.0
[root@VM_123_144_centos node01]# node -v
v6.4.0
测试cnpm
[root@VM_123_144_centos node01]# npm install --save express
hello@1.0.0 /root/node01
`-- express@4.14.0
+-- accepts@1.3.3
| +-- mime-types@2.1.11
| | `-- mime-db@1.23.0
| `-- negotiator@0.6.1
+-- array-flatten@1.1.1
+-- content-disposition@0.5.1
+-- content-type@1.0.2
+-- cookie@0.3.1
+-- cookie-signature@1.0.6
+-- debug@2.2.0
| `-- ms@0.7.1
+-- depd@1.1.0
+-- encodeurl@1.0.1
+-- escape-html@1.0.3
+-- etag@1.7.0
+-- finalhandler@0.5.0
| +-- statuses@1.3.0
| `-- unpipe@1.0.0
+-- fresh@0.3.0
+-- merge-descriptors@1.0.1
+-- methods@1.1.2
+-- on-finished@2.3.0
| `-- ee-first@1.1.1
+-- parseurl@1.3.1
+-- path-to-regexp@0.1.7
+-- proxy-addr@1.1.2
| +-- forwarded@0.1.0
| `-- ipaddr.js@1.1.1
+-- qs@6.2.0
+-- range-parser@1.2.0
+-- send@0.14.1
| +-- destroy@1.0.4
| +-- http-errors@1.5.0
| | +-- inherits@2.0.1
| | `-- setprototypeof@1.0.1
| `-- mime@1.3.4
+-- serve-static@1.11.1
+-- type-is@1.6.13
| `-- media-typer@0.3.0
+-- utils-merge@1.0.0
`-- vary@1.1.0
npm WARN hello@1.0.0 No repository field.
==================Enjoy it================
CNPM 遇到use strict的问题的更多相关文章
- CentOS:ECDSA host key "ip地址" for has changed and you have requested strict checking(转)
原文地址:http://blog.csdn.net/ausboyue/article/details/52775281 Linux SSH命令错误:ECDSA host key "ip地址& ...
- cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'mvc:annotation-driven'.
spring 配置文件报错报错信息:cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be ...
- How to Disable Strict SQL Mode in MySQL 5.7
If your app was written for older versions of MySQL and is not compatible with strict SQL mode in My ...
- Linux中安装NodeJs 、cnpm 、npm
一.安装NodeJs 切换到 cd /usr/local/src/ 下载nodejs wget https://nodejs.org/dist/v6.9.3/node-v6.9.3-linux-x64 ...
- npm淘宝镜像cnpm
npm install -g cnpm --registry=https://registry.npm.taobao.org
- PHP中Strict Standards错误解决方法二
在PHP5.3.3 中安装wordpress 3.0.1 ,在安装时出现错误:Strict Standards: PHP Strict Standards: Declaration of Walker ...
- PHP Strict Standards:问题解决
异常信息: ( ! ) Strict standards: Declaration of SugarEmailAddress::save() should be compatible with tha ...
- 带有“非简单参数”的函数为什么不能包含 "use strict" 指令
非简单参数就是 ES6 里新加的参数语法,包括:1.默认参数值.2.剩余参数.3.参数解构.本文接下来要讲的就是 ES7 为什么禁止在使用了非简单参数的函数里使用 "use strict&q ...
- 已解决:Strict Standards: Only variables should be passed by reference in
今天安装ecshop的时候最上面出现了一个错误提示:Strict Standards: Only variables should be passed by reference in F:\www.x ...
随机推荐
- 老李分享:robotium3.6与4.0 later 的区别 2
再仔细看了下4.0中的方法: java.util.ArrayList<android.view.View> getCurrentViews() Returns an ...
- 老李分享:《Linux Shell脚本攻略》 要点(二)
老李分享:<Linux Shell脚本攻略> 要点(二) poptest是国内唯一一家培养测试开发工程师的培训机构,以学员能胜任自动化测试,性能测试,测试工具开发等工作为目标.如果对课 ...
- (function($){….})(jQuery)一种js插件写法
我们先看第一个括号里边的内容:function($){….},这不就是一个匿名的函数吗?但是它的形参比较奇怪,是$,这里主要是为了不与其它的库冲突. 这样我们就比较容易理解第一个括号内的内容就是定义了 ...
- mybatis新手入门常见问题集(持续更新)
一.参数为集合 Q:parameterType指的的类型是集合类型还是对象? A:都可以,甚至不用在xml中指定也可以.第一,mybatis会对传入的参数进行判断是不是list或者array,第二,m ...
- 泛型(CSDN转载)
函数的参数不同叫多态,函数的参数类型可以不确定吗? 函数的返回值只能是一个吗?函数的返回值可以不确定吗? 泛型是一种特殊的类型,它把指定类型的工作推迟到客户端代码声明并实例化类或方法的时候进行. 下面 ...
- 除去ubuntu的grub引导
除去ubuntu的grub引导 step如下>> 进入ubuntu终端 sudo gedit /etc/defauli/grub 将 #GRUB_HIDDEN_TIMEOUT=0 最前面的 ...
- 启动LUXContentTests过程中遇到的问题
首先,要想在localbox中使用Selenium,就得准备好浏览器的driver文件.比如chrome对应的chromedriver文件,该文件是一个exe可执行文件. 问题:当我尝试去跑LUXCo ...
- 【stm32】时钟树解析
有时候会突然忘了这个重要的时钟树,这里转载一个比较好的,以防忘记. STM32时钟系统 在STM32中,有五个时钟源,为HSI.HSE.LSI.LSE.PLL. ①HSI是高速内部时钟,RC振荡器,频 ...
- 玩转SSH端口转发
SSH有三种端口转发模式,本地端口转发(Local Port Forwarding),**远程端口转发(Local Port Forwarding)**以及**动态端口转发(Dynamic Port ...
- 仿QQ空间动态界面分享
先看看效果: 用极少的代码实现了 动态详情 及 二级评论 的 数据获取与处理 和 UI显示与交互,并且高解耦.高复用.高灵活. 动态列表界面MomentListFragment支持 下拉刷新与上拉加载 ...