我怎样换一个包裹?Json的名字

时间:2021-06-24 07:25:01

In this package.json file

在这个包中。json文件

{
  "name": "Orignal Name",
  "version": "0.0.1",
  "description": "An App",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "engines": {
    "node": "0.10.x",
    "npm": "1.3.x"
  },
  "author": "An author",
  "license": "BSD-2-Clause",
  "dependencies": {
    "jade": "~0.35.0",
    "express": "~3.4.4",
    "stylus": "~0.40.2",
    "mongoose": "~3.8.0",
    "passport-local": "~0.1.6",
    "passport": "~0.1.17"
  },
  "devDependencies": {
    "karma-mocha": "~0.1.0",
    "mocha": "~1.14.0",
    "karma-chai-plugins": "~0.1.3",
    "karma-firefox-launcher": "~0.1.0",
    "karma-chrome-launcher": "~0.1.0",
    "karma-script-launcher": "~0.1.0",
    "karma-html2js-preprocessor": "~0.1.0",
    "karma-jasmine": "~0.1.3",
    "requirejs": "~2.1.9",
    "karma-requirejs": "~0.2.0",
    "karma-coffee-preprocessor": "~0.1.0",
    "karma-phantomjs-launcher": "~0.1.0",
    "karma": "~0.10.5"
  }
}

How Do I change the "name": attribute "Original Name" to "New Name" without breaking npm install.

如何在不破坏npm安装的情况下将“name”改为“New name”?

I tried simply updating the name and attempting npm install but npm install won't read the package.json file now.

我只是尝试更新名称并尝试npm安装,但是npm安装不会读取包。json文件。

Thanks in advance

谢谢提前

1 个解决方案

#1


4  

just edit the name in package.json. The name must following the rules https://docs.npmjs.com/files/package.json#name

只需在package.json中编辑名称。名称必须遵循以下规则:https://docs.npmjs.com/files/package.json#name

#1


4  

just edit the name in package.json. The name must following the rules https://docs.npmjs.com/files/package.json#name

只需在package.json中编辑名称。名称必须遵循以下规则:https://docs.npmjs.com/files/package.json#name