【问题标题】:how to update/upgrade sails project with node js and all its dependency如何使用节点 js 及其所有依赖项更新/升级sails 项目
【发布时间】:2016-06-21 05:50:20
【问题描述】:

我尝试使用“npm update”和“ncu”,但收到以下警告和错误,如下所示:

在控制台:

npm WARN ENOENT ENOENT: no such file or directory, open 'Proj_Dir/node_modules/grunt-legacy-log/package.json'

npm WARN ENOENT ENOENT: no such file or directory, open 'Proj_Dir/node_modules/grunt-legacy-log-utils/package.json'


npm ERR! enoent ENOENT: no such file or directory, rename 'Proj_Dir/node_modules/sails-generate-frontend/node_modules/lodash' -> 'Proj_Dir/node_modules/grunt-contrib-less/node_modules/lodash'

npm ERR! enoent This is most likely not a problem with npm itself

npm ERR! enoent and is related to npm not being able to find a file.

npm ERR!     Proj_Dir/npm WARN ENOENT ENOENT: no such file or directory, open 'Proj_Dir/node_modules/grunt-legacy-log/package.json'

npm WARN ENOENT ENOENT: no such file or directory, open 'Proj_Dir/node_modules/grunt-legacy-log-utils/package.json'



npm ERR! enoent ENOENT: no such file or directory, rename 'Proj_Dir/node_modules/sails-generate-frontend/node_modules/lodash' -> 'Proj_Dir/node_modules/grunt-contrib-less/node_modules/lodash'

npm ERR! Please include the following file with any support request:
npm ERR!     Proj_Dir/npm-debug.log

npm-debug.log
-------------

37224 warn ENOENT ENOENT: no such file or directory, open 'Proj_Dir/node_modules/grunt-legacy-log/package.json'

37225 warn ENOENT ENOENT: no such file or directory, open 'Proj_Dir/node_modules/grunt-legacy-log-utils/package.json'

37226 verbose stack Error: ENOENT: no such file or directory, rename 'Proj_Dir/node_modules/sails-generate-frontend/node_modules/lodash' -> 'Proj_Dir/node_modules/grunt-contrib-less/node_modules/lodash'



37232 error path Proj_Dir/node_modules/sails-generate-frontend/node_modules/lodash

37236 error enoent ENOENT: no such file or directory, rename 'Proj_Dir/node_modules/sails-generate-frontend/node_modules/lodash' -> 'Proj_Dir/node_modules/grunt-contrib-less/node_modules/lodash'

【问题讨论】:

  • 未清除,你在问什么。
  • 我在控制台的sails项目目录中使用'npm update'命令,但这给了我上面提到的警告和错误。现在我无法解除我的风帆申请。

标签: node.js sails.js


【解决方案1】:

假设你有sails 0.11.0版,运行这个命令。

npm install sails@~0.12.0 --force --save

更多详情请访问官方site

像大多数 Node 包一样,Sails 尊重语义版本控制。例如,如果您使用 Sails v0.11.3,然后升级到 Sails v0.11.4,则不需要更改应用程序代码。这称为补丁版本。另一方面,如果您从 Sails v0.11.3 升级到 v0.12.0,您可能会遇到一些重大变化——这意味着您需要更改 Sails 应用程序的代码才能使用新版本。

备注

一旦 Sails v1.0 发布,次要版本的颠簸将不会导致 破坏性变化——例如从 v1.1.0 升级到 v1.2.0 应该 不强迫您更改代码;而升级到 v2.0.0 可能。

如果您落后于最新版本不止一个次要版本并遇到 困难,请考虑一次更新您的应用程序。这 迁移指南的编写考虑了特定的版本差异 正如您可能很清楚的那样,当有疑问时,最好 尽可能多地隔离变量。例如,如果你是 运行 Sails v0.9 并尝试升级到 Sails v0.12 但有 麻烦,先升级到 Sails v0.10,然后是 v0.11,然后是 v0.12。

【讨论】:

  • 这是我在这个网站上的第一个问题,我在一天之内就得到了回复 :) 。你的回复对我帮助很大!谢谢:)
  • 很高兴为您提供帮助 :))
猜你喜欢
  • 2017-11-26
  • 2019-12-05
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-06-01
  • 2014-07-08
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多