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 ...
随机推荐
- div背景图片或颜色不显示的解决办法
背景图片不显示的原因: 1. css没有被调用 2. css图片地址不对 3. div的高度没有固定,是auto.没有设值或者高度不够 4. div被嵌套 5. div代码不规范 解决办法: (1)D ...
- kafka使用实例
定义一个procucer package cn.vko.common.kafka; import java.util.Properties; import org.apache.commons.lan ...
- 大数据测试之hadoop集群配置和测试
大数据测试之hadoop集群配置和测试 一.准备(所有节点都需要做):系统:Ubuntu12.04java版本:JDK1.7SSH(ubuntu自带)三台在同一ip段的机器,设置为静态IP机器分配 ...
- 老李案例分享:Weblogic性能优化案例
老李案例分享:Weblogic性能优化案例 POPTEST的测试技术交流qq群:450192312 网站应用首页大小在130K左右,在之前的测试过程中,其百用户并发的平均响应能力在6.5秒,性能优化后 ...
- BitMap 算法
什么是 BigMap 算法 所谓 BitMap 就是用一个 bit 位来标记某个元素对应的 value,而 key 即是这个元素.由于采用bit为单位来存储数据,因此在可以大大的节省存储空间. 算法思 ...
- SQL Server-基础-经典SQL语句
经典SQL语句 基础 .说明:创建数据库 CREATE DATABASE database-name .说明:删除数据库 drop database dbname .说明:备份sql server - ...
- ASP.NET Core MVC和Visual Studio入门
本教程将教你使用Visual Studio 2017创建 ASP.NET Core MVC web应用程序的基础知识. 安装Visual Studio 2017 和.Net Core 安装Visual ...
- chrome浏览器tab页内存占用变大,网站变慢为哪般?
问题概述: 公司做的是BS应用. 之前我们的后台服务器程序是带状态的,用ehcache存储登录状态:这两天被我改成了redis存储,应用本身不再存储登录状态. 然后自测,我在测试某个很耗时间的网页操作 ...
- Spring Cloud搭建微服务架构----前言
前言 微服务并不神秘,只是在互联网技术发展过程中的一个产物,整个架构系统随着客户端的多样性,服务越来越多,devops的发展而产生的架构变种. 许多公司,通过采用微处理结构模式解决单体应用的问题,分解 ...
- Java设计模式:桥接模式
问题提出 生活中有很多事物集合,设为A1,A2......Am ,而每个事物都有功能F1,F2....Fn. 例如邮局的发送业务.简单模拟有两类事物:信件和包裹,均有平邮和挂号邮寄功能.程序设计中如何 ...