老师非得让我们用CNPM,所以在下面记录下
安装CNPM的命令如下
npm install -g cnpm –registry=https://registry.npmmirror.com
安装的话直接
cnpm install
个人我非常不推荐这样子使用,我推荐使用修改registry方法来实现镜像
注意 如果报下面的错误:
npm error arg Argument starts with non-ascii dash, this is probably invalid: –registry=https://registry.npmmirror.com
npm error code ENOENT
npm error syscall open
npm error path C:\Users\q2019\–registry=https:\registry.npmmirror.com\package.json
npm error errno -4058
npm error enoent Could not read package.json: Error: ENOENT: no such file or directory, open 'C:\Users\q2019\–registry=https:\registry.npmmirror.com\package.json'
npm error enoent This is related to npm not being able to find a file.
npm error enoent
npm error A complete log of this run can be found in: C:\Users\q2019\AppData\Local\npm-cache\_logs\2025-06-16T03_37_06_546Z-debug-0.log
请检查你复制的安装命令是否变成了
npm install express –registry=https://registry.npmmirror.com
检查registry前面的两个–是否编程了一个-