gpt4 book ai didi

node.js - 在 heroku 上安装 jade 时出错

转载 作者:搜寻专家 更新时间:2023-10-31 23:43:38 26 4
gpt4 key购买 nike

将我的 node.js-app 推送到 Heroku 时出现错误。它曾经有效,但现在由于某种原因,它失败了。

当我推送到 Heroku 时,我得到以下信息:

-----> Node.js app detected
-----> Resolving engine versions
Using Node.js version: 0.6.13
Using npm version: 1.1.4
-----> Fetching Node.js binaries
-----> Vendoring node into slug
-----> Installing dependencies with npm
npm http GET https://registry.npmjs.org/express/2.5.9
npm http GET https://registry.npmjs.org/jade/0.15.4
npm http 200 https://registry.npmjs.org/jade/0.15.4
npm http GET https://registry.npmjs.org/jade/-/jade-0.15.4.tgz
npm http 200 https://registry.npmjs.org/express/2.5.9
npm http GET https://registry.npmjs.org/express/-/express-2.5.9.tgz
npm http 200 https://registry.npmjs.org/jade/-/jade-0.15.4.tgz
npm http 200 https://registry.npmjs.org/express/-/express-2.5.9.tgz
npm ERR! error installing jade@0.15.4

npm ERR! Refusing to delete: /tmp/build_dzqaws2o7lx4/node_modules/.bin/jade not in /tmp/build_dzqaws2o7lx4/node_modules/jade
npm ERR! File exists: /tmp/build_dzqaws2o7lx4/node_modules/.bin/jade
npm ERR! Move it away, and try again.
npm ERR!
npm ERR! System Linux 2.6.32-348-ec2
npm ERR! command "/tmp/node-node-HkEc/bin/node" "/tmp/node-npm-X5Wz/cli.js" "install" "--production"
npm ERR! cwd /tmp/build_dzqaws2o7lx4
npm ERR! node -v v0.6.13
npm ERR! npm -v 1.1.4
npm ERR! path /tmp/build_dzqaws2o7lx4/node_modules/.bin/jade
npm ERR! code EEXIST
npm ERR! message Refusing to delete: /tmp/build_dzqaws2o7lx4/node_modules/.bin/jade not in /tmp/build_dzqaws2o7lx4/node_modules/jade
npm ERR! errno {}
npm http GET https://registry.npmjs.org/connect
npm http GET https://registry.npmjs.org/mime/1.2.4
npm http GET https://registry.npmjs.org/qs
npm http GET https://registry.npmjs.org/mkdirp/0.3.0
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /tmp/build_dzqaws2o7lx4/npm-debug.log
npm not ok
! Failed to install --production dependencies with npm
! Heroku push rejected, failed to compile Node.js app

我的 package.json 如下:

{
"name": "myAppName",
"version": "0.0.1",
"dependencies": {
"express": "2.5.9",
"mongoose":"3.5.2",
"jade": "0.15.4",
"ejs": "0.7.1"
},
"engines": {
"node": "0.6.13",
"npm": "1.1.4"
}
}

因为它说“拒绝删除:...”我认为这可能是 Heroku 上的异常错误,所以我尝试将它推送到新的 Heroku 应用程序,但我得到了同样的错误。

有什么问题吗?是我的版本吗?一切都在本地(Windows)运行良好。任何帮助将不胜感激。

最佳答案

您正在使用旧的 node.js。尝试将以下内容添加到 package.json:

  "engines": {
"node": "0.8.x",
"npm": "1.1.x"
},

您可以通过登录系统更仔细地检查事物。首先你需要安装Heroku Toolbelt (如果你还没有)。然后:

heroku login

heroku run bash --app yourapp

这将为您的 heroku 安装提供一个 bash。导航到 /tmp (cd/tmp) 并查看那里剩下的内容。尝试手动删除它 (rm -rf whatisleft)。

你的 jade 版本也已经过时了(仍然)。我用 jade 安装的 heroku 有:

"jade": "*"

最后,不要将 node_modules 添加到源代码管理中。所以将它添加到您的 .gitignore 文件中。

关于node.js - 在 heroku 上安装 jade 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14173373/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com