更新时间:2024-05-10 GMT+08:00
Unexpected end of JSON ...
问题现象
执行npm install时,提示异常信息如下:
原因分析
解析文件中的json字符串失败,有可能从镜像仓下载的文件不完整。
处理方法
- 修改Npm镜像仓,在Npm构建步骤里,添加如下命令:
1
npm config set registry https://repo.xxcloud.com/repository/npm/
或
npm config set registry https://registry.npm.taobao.org
- 重新执行构建任务。
父主题: Npm构建
Npm构建 所有常见问题
- JavaScript heap out of memory
- Unexpected end of JSON ...
- enoent ENOENT: no such file or directory
- Module not found: Error: Can't resolve ...
- NPM构建失败,但不显示错误日志
- npm cb() never called
- gyp ERR! stack Error: EACCES: permission denied
- eslint: error 'CLODOP' is not defined
- node-sass下载失败
- error: could not write config file
- npm构建耗时且安装依赖缓慢
- 找不到依赖版本
more