gpt4 book ai didi

heroku - heroku 上没有安装 node_modules

转载 作者:行者123 更新时间:2023-12-05 01:45:58 26 4
gpt4 key购买 nike

下面是两个包,我试图用它们将我的项目推送到 heroku,控制台说 npm 和节点安装在服务器上但是当我克隆项目时,项目中没有 node_modules 目录。 package.json 中的“bower install”表示未找到 bower。当我删除“bower install”时,推送时服务器上没有安装任何依赖项,尽管控制台将它们记录为已安装,但当我打开浏览器控制台时,它们并未安装在服务器上。

package.json:

{
"name": "meal-order",
"version": "0.0.0",
"description": "This is an app for ordering meal",
"main": "gulpfile.js",
"dependencies": {
"angular": "^1.5.5",
.....(other angular -libs)
"express": "^4.14.0",
"gulp": "^3.8.8",
"gulp-connect": "^3.0.9",
"ionicons": "^3.0.0",
"protractor": "^3.3.0"
},
"devDependencies": {
"bower": "1.7.7"
},
"engines": {
"node": "^5.11.1",
"npm": "^3.8.6"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node index.js",
"postinstall": "bower install"
},

bower.json:

"dependencies": {
"angular": "^1.5.5",
.....(other angular -libs)
"express": "^4.14.0",
"gulp": "^3.8.8",
"gulp-connect": "^3.0.9",
"ionicons": "^3.0.0",
"protractor": "^3.3.0"
},
"devDependencies": {},
"main": "gulpfile.js",
"license": "ISC",
"moduleType": [
"node"
],

.gitignore:

/node_modules/*
node_modules/*
node_modules
npm-debug.log

这是我在控制台上得到的错误:

remote: -----> Restoring cache
remote: Skipping cache restore (new runtime signature)
remote:
remote: -----> Building dependencies
remote: Installing node modules (package.json)
remote:
remote: > meal-order@0.0.0 postinstall /tmp/build_3ac183217c4c79ebe98cbb69eecb36de
remote: > bower install
remote:
remote: sh: 1: bower: not found
remote:
remote: npm ERR! Linux 3.13.0-91-generic

最佳答案

这是因为您在 package.jsondevDependencies 对象中定义了 bower。当你推送到 Heroku 时,它不会安装 devDependencies 中列出的东西,所以你需要在你的普通 dependencies 对象中列出 bower =)

关于heroku - heroku 上没有安装 node_modules,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38956141/

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