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 ...
随机推荐
- 测试开发Python培训:模拟登录新浪微博-技术篇
测试开发Python培训:模拟登录新浪微博-技术篇 一般一个初学者项目的起点就是登陆功能的自动化,而面临的项目不同实现的技术难度是不一样的,poptest在做测试开发培训中更加关注技术难点,掌握技 ...
- SpringBoot-SpringMvc的Interceptor拦截器配置
Interceptor拦截器实现对每一个用户请求处理前后的业务处理,比如我们需要对用户请求进行响应时间的记录,需要记录请求从开始到结束所耗的时间,这时我们就需要用到拦截器了 下面我们以记录请求处理时间 ...
- 在my.ini文件中配置mysql统一字符集
测试的mysql版本为:5.7.14 查看mysql字符集命令: show variables like 'character_set_%'; 以下是在my.ini文件中配置mysql统一字符集参数: ...
- 程序设计 之 C#实现《拼图游戏》
功能描述: 1.用户自定义上传图片 2.游戏难度选择:简单(3*3).一般(5*5).困难(9*9)三个级别 3.纪录完成步数 模块: 1.拼图类 2.配置类 3.游戏菜单窗口 4.游戏运行窗口 -- ...
- 复杂SQL查询实例-5种普惠产品必须显示...
复杂SQL需求: 1.查询productCode in (1, 2, 4, 5, 7)五种 2.5种产品必须固定显示,优先显示procuct_status='1'在售产品,在售产品卖完则售罄产品顶上来 ...
- 2017-4-18 ADO.NET
1.什么是ADO.NET? (是一种数据库访问技术) ADO.NET的名称起源于ADO(ActiveX Data Objects),是一个COM组件库,用于在以往的Microsoft技术中访问 ...
- 基于Maven的SSM整合的web工程
此文章主要有以下几个知识点: 一.如何创建 Maven的Web 工程 二.整合SSM(Spring,SpringMvc,Mybatis),包括所有的配置文件 三.用 mybatis 逆向工程生成对应的 ...
- 少年,是时候换种更优雅的方式部署你的php代码了
让我们来回忆下上次你是怎么发布你的代码的: 1. 先把线上的代码用ftp备份下来 2. 上传修改了的文件 3. 测试一下功能是否正常 4. 网站500了,赶紧用备份替换回去 5. 替换错了/替换漏了 ...
- js函数中this的指向
本文是我个人对this指向的一些理解,如有不足之处,还望大家可以批评指正,在此先谢过了! 首先,我们来回顾一下ES5里函数的几种调用方式: 1⃣️直接调用 foo(); 2⃣️方法调用 obj.foo ...
- CodeSmith生成实体的分页读取规则
首先.我得向咱们博客园提个意见,能不能我写的东西就给预保存下呢?刚才我写半天,只因为这个不给力的IE浏览器死了,导致我白写了,如果这要是那个大神直接在这上面写的非常有技术含量的贴着会因此而丢失实在是有 ...