一、问题描述

[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的问题的更多相关文章

  1. 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地址& ...

  2. 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 ...

  3. 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 ...

  4. Linux中安装NodeJs 、cnpm 、npm

    一.安装NodeJs 切换到 cd /usr/local/src/ 下载nodejs wget https://nodejs.org/dist/v6.9.3/node-v6.9.3-linux-x64 ...

  5. npm淘宝镜像cnpm

    npm install -g cnpm --registry=https://registry.npm.taobao.org

  6. PHP中Strict Standards错误解决方法二

    在PHP5.3.3 中安装wordpress 3.0.1 ,在安装时出现错误:Strict Standards: PHP Strict Standards: Declaration of Walker ...

  7. PHP Strict Standards:问题解决

    异常信息: ( ! ) Strict standards: Declaration of SugarEmailAddress::save() should be compatible with tha ...

  8. 带有“非简单参数”的函数为什么不能包含 "use strict" 指令

    非简单参数就是 ES6 里新加的参数语法,包括:1.默认参数值.2.剩余参数.3.参数解构.本文接下来要讲的就是 ES7 为什么禁止在使用了非简单参数的函数里使用 "use strict&q ...

  9. 已解决:Strict Standards: Only variables should be passed by reference in

    今天安装ecshop的时候最上面出现了一个错误提示:Strict Standards: Only variables should be passed by reference in F:\www.x ...

随机推荐

  1. 20155214 2016-2017-2 《Java程序设计》第5周学习总结

    20155214 2016-2017-2 <Java程序设计>第5周学习总结 教材学习内容总结 1.错误会被包装为可抛出的对象,继承自java.lang.Throwable类. 2.可以利 ...

  2. 【Electron】Electron开发入门(六):项目生成setup安装程序

    把electron发布的exe打包成setup安装程序,需要使用nsis软件, nsis打包的详细教程,可以参考我的这篇文章: win7下nsis打包exe安装程序教程

  3. 【转】一个小工具类,利用shareObject把数据缓存

    原文链接:http://bbs.9ria.com/thread-284082-1-2.html 之前做一个数据缓存,就顺便把写入缓存,清除缓存,获取缓存都整理了一下,其中也做了些参考,个人水平有限,有 ...

  4. 老李秘技:loadrunner11.5支持net4.0么?

    老李秘技:loadrunner11.5支持net4.0么?   LoadRunner12.0以前的版本不支持.NET 4.0,已经证实R&D团队将在下一版本的LoadRunner即LoadRu ...

  5. Uva 10892 LCM Cardinality (数论/暴力)

    题意:给出数n,求有多少组A,B的最小公约数为n; 思路:3000ms,直接暴力寻找,找到所有能把n整除的数 pi, 枚举所有pi 代码: #include <iostream> #inc ...

  6. JavaScript基础学习(九)—DOM

    一.DOM概述      DOM(Document Object Model)文本对象模型.      D: 文档,HTML文档或XML文档.      O: 对象,document对象的属性和方法. ...

  7. Android系统--输入系统(七)Reader_Dispatcher线程启动分析

    Android系统--输入系统(七)Reader_Dispatcher线程启动分析 1. Reader/Dispatcher的引入 对于输入系统来说,将会创建两个线程: Reader线程(读取事件) ...

  8. SQL基础函数

    首先咱们一起来看一下SQL的基本函数 一.聚合函数 二.数学函数 三.字符串函数 四.转换函数 五.时间函数 这样子看起来可能很多,那咱们给变得---------------------------- ...

  9. 主机ping通虚拟机,虚拟机ping通主机解决方法(NAT模式)

    有时候需要用虚拟机和宿主机模拟做数据交互,ping不通是件很烦人的事,本文以net模式解决这一问题. 宿主机系统:window7 虚拟机系统:CentOs7 连接方式:NAT模式 主机ping通虚拟机 ...

  10. Neural Networks and Deep Learning(神经网络与深度学习) - 学习笔记

    catalogue . 引言 . 感知器及激活函数 . 代价函数(loss function) . 用梯度下降法来学习-Learning with gradient descent . 用反向传播调整 ...