【问题标题】:Issue with deployment of sails.js app on Heroku - npm error - package: sailshq/body-parser在 Heroku 上部署sails.js 应用程序的问题 - npm 错误 - 包:sailsq/body-parser
【发布时间】:2018-01-31 07:02:13
【问题描述】:

开始,当前配置 - 开发机器:

  • 节点版本:8.4.0
  • Npm:5.3.0(8.4 自带)
  • 帆:~0.12.13
  • 源码控制系统:Github
  • 部署主机:Heroku

我遵循以下指南:https://vort3x.me/sailsjs-heroku/(heroku git 部分除外,使用 github)

但是当我在 Heroku 中按 deploy 时,我相当卡住,会发生以下情况:

-----> Creating runtime environment        

       NPM_CONFIG_LOGLEVEL=error

       NPM_CONFIG_PRODUCTION=true

       NODE_VERBOSE=false

       NODE_ENV=production

       NODE_MODULES_CACHE=false

-----> Installing binaries

       engines.node (package.json):  8.4.0

       engines.npm (package.json):   unspecified (use default)



       Resolving node version 8.4.0...

       Downloading and installing node 8.4.0...

       Detected package-lock.json: defaulting npm to version 5.x.x

       Bootstrapping npm 5.x.x (replacing 5.3.0)...

       npm 5.3.0 installed

-----> Restoring cache

       Skipping cache restore (disabled)

-----> Building dependencies

       Installing node modules (package.json + package-lock)

       npm ERR! path /tmp/build_7f8d8515578971e692c2e6a35e1006d2/bdemolder-boardgamenights-f5eda42/node_modules/.staging/sails-fec6f6e5/node_modules/@sailshq/body-parser

       npm ERR! code ENOENT

       npm ERR! errno -2

       npm ERR! syscall rename

       npm ERR! enoent ENOENT: no such file or directory, rename '/tmp/build_7f8d8515578971e692c2e6a35e1006d2/bdemolder-boardgamenights-f5eda42/node_modules/.staging/sails-fec6f6e5/node_modules/@sailshq/body-parser' -> '/tmp/build_7f8d8515578971e692c2e6a35e1006d2/bdemolder-boardgamenights-f5eda42/node_modules/.staging/@sailshq/body-parser-9ed21a9f'

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

       npm ERR! enoent



       npm ERR! A complete log of this run can be found in:

       npm ERR!     /app/.npm/_logs/2017-08-22T20_43_13_796Z-debug.log

-----> Build failed

坦率地说,我不知道该怎么办,我首先认为这是因为我忘了说引擎“节点:8.4.0”并且我的缓存已损坏,所以我尝试禁用缓存,但到目前为止没有.

它说要重命名,但我无法控制 Sails.js 中的依赖关系? 可能是做错了什么……

谢谢和亲切的问候

PS:我会继续寻找自己,如果我发现了什么,我会回答。

【问题讨论】:

  • 我可以告知切换到 yarn 不会导致错误。所以...这纯粹是 npm?

标签: heroku deployment npm sails.js body-parser


【解决方案1】:

只需删除 package-lock.json,提交并推送到 Heroku!

【讨论】:

    猜你喜欢
    • 2015-02-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-10-22
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多