安装
- 安装了nodejs就会自动安装npm,但是由于npm下载东西经常需要翻墙,所以我们用淘宝镜像cnpm代替npm
- 如下图使用
npm install -g cnpm --registry=https://registry.npm.taobao.org
安装cnpm,
通过npm安装cnpm
- 上图使用的工具是Cmder,想知道更多点这里
常用命令
npm常用命令和cnpm常用命令是一样的
安装包
cnpm i <pkg> 或者 cnpminstall <pkg> 或者 cnpm i <pkg>@<version> 或者 cnpminstall <pkg>@<version>
卸载包
cnpm uninstall <name> 或者 cnpm uninstall <name>@[<version>]
查看当前项目下的包列表
cnpm ls
查看全局包列表
cnpm ls -g
清理缓存
cnpm cache clean
网友评论
* What went wrong:
Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at https://docs.gradle.org/
2.14.1/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------
Error occurred during initialization of VM
Could not reserve enough space for 2097152KB object heap
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.
Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* What went wrong:
Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at https://docs.gradle.org/
2.14.1/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------
Error occurred during initialization of VM
Could not reserve enough space for 2097152KB object heap
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.
打包出现这个错误是什么原因 弄了好久,搞不懂,求救
报这个错误
C:\Users\Administrator>java -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
C:\Users\Administrator>javac -version
javac 1.8.0_131
C:\Users\Administrator>node -v
v6.10.3
C:\Users\Administrator>npm -v
3.10.10
C:\Users\Administrator>npm install -g cnpm --registry=https://registry.npm.taoba
o.org
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\
node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "cnpm" "--registry=https://re
gistry.npm.taobao.org"
npm ERR! node v6.10.3
npm ERR! npm v3.10.10
npm ERR! code UNABLE_TO_VERIFY_LEAF_SIGNATURE
npm ERR! unable to verify the first certificate
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\Administrator\npm-debug.log
求解决!!!