json - 如何更改 package.json 中的名称属性?

标签 json node.js

我的 package.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"
  }
}

如何在不破坏 npm install 的情况下将 "name": 属性 "Original Name" 更改为 "New Name" ?

我尝试简单地更新名称并尝试 npm install 但 npm install 现在不会读取 package.json 文件。

提前致谢

最佳答案

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

关于json - 如何更改 package.json 中的名称属性?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26039633/

相关文章:

java - Spring Controller - 将 JSON 属性映射到外键实体

json格式转csv格式,使用R

javascript - 从 ElasticSearch 获取 json 的子集

node.js - [错误: failed to connect to [localhost:27017]] from NodeJS to mongodb

javascript - 带有路由器的 Node.js (Express) 错误处理中间件

node.js - 从导出的模块触发socket.emit

mysql - 如何在嵌套数组 json 上选择带有条件的 mysql?

javascript - 嵌套的 JSON.parse 错误和 JS 对象遍历错误未被 JS try/catch 捕获,导致服务器崩溃

node.js - 如何使用 next 在 AWS S3 上托管静态文件?

node.js - 错误 : [ioredis] Unhandled error event: Error: connect ETIMEDOUT