npm WARN: No repository field.

简介: npm WARN: No repository field.

前言


在使用 npm 安装包时,遇到 npm Warn name@x.x.x No repository field.


意思是你的 package.json 缺少 repository 仓库字段。可采用以下两种方式解决 WARNING。


正文


一、你的项目有仓库地址时:

// package.json
{
  "repository": {
    "type": "git",
    "url": "http://github.com/yourname/repositoryname.git"
  }
}


二、作为测试、练习项目没有仓库地址时,将项目声明为私有,这样就不会有提示了。

// package.json
{
  "private": true
}


目录
相关文章
npm WARN deprecated core-js@2.6.12 core-js@<3.3 is no longer maintained and not recommended for usa
npm WARN deprecated core-js@2.6.12 core-js@<3.3 is no longer maintained and not recommended for usa
448 0
|
缓存 JavaScript
解决node与npm版本不一致,出现npm WARN npm npm does not support Node.js v15.14.0
解决node与npm版本不一致,出现npm WARN npm npm does not support Node.js v15.14.0
解决node与npm版本不一致,出现npm WARN npm npm does not support Node.js v15.14.0
|
6月前
|
JavaScript
报错:npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
报错:npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
114 2
|
11月前
Error:npm WARN enoent ENOENT: no such file or directory, open ‘C:\Users\XX\package.json‘son‘
Error:npm WARN enoent ENOENT: no such file or directory, open ‘C:\Users\XX\package.json‘son‘
|
JavaScript
npm WARN npm npm does not support Node.js v16.14.2 npm WARN npm You should probably upgrade to a new
npm WARN npm npm does not support Node.js v16.14.2 npm WARN npm You should probably upgrade to a new
407 0
npm WARN deprecated socks@1.1.10: If using 2.x branch, please upgrade to at least 2.1.6
npm WARN deprecated socks@1.1.10: If using 2.x branch, please upgrade to at least 2.1.6
117 0
npm WARN deprecated socks@1.1.10: If using 2.x branch, please upgrade to at least 2.1.6
npm WARN lifecycle yarn@1.22.19~preinstall: cannot run in wd %s %s
npm WARN lifecycle yarn@1.22.19~preinstall: cannot run in wd %s %s
883 0
|
前端开发
前端项目实战2-npm WARN config global --global, --local are deprecated. Use `–location解决方案
前端项目实战2-npm WARN config global --global, --local are deprecated. Use `–location解决方案
1194 0
|
1月前
|
缓存 资源调度 JavaScript
npx与npm的差异解析,以及包管理器yarn与Node版本管理工具nvm的使用方法详解
npx与npm的差异解析,以及包管理器yarn与Node版本管理工具nvm的使用方法详解
32 0
2071 verbose node v16.6.0 2072 verbose npm v7.19.1或者 no such file or directory, lstat ‘D:\wor
该博客文章提供了解决在使用npm版本7.19.1时出现的"no such file or directory"错误的具体方法,建议通过降级npm到6.14.8版本来解决问题,并确认了该方法可以成功安装node_modules。
2071 verbose node v16.6.0 2072 verbose npm v7.19.1或者 no such file or directory, lstat ‘D:\wor
下一篇
无影云桌面