Tôi cố gắng để triển khai một Node.js đơn giản thể hiện dựa trên ứng dụng để Heroku, cái gì đó rõ ràng là rất cơ bản: https://devcenter.heroku.com/articles/nodejsFail để triển khai ứng dụng Node.js để Heroku
Dưới đây là package.json tôi:
{
"name": "cours-lic3-blois",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node app"
},
"dependencies": {
"express": "*",
"ejs": "*",
"github-flavored-markdown": "*",
"less-middleware": "*"
},
"engines": {
"node": "0.8.8",
"npm": "1.1.65"
}
}
Khi tôi git push heroku master
tôi đã nhận các dấu vết sau:
-----> Heroku receiving push
-----> Node.js app detected
-----> Resolving engine versions
Using Node.js version: 0.8.8
Using npm version: 1.1.65
-----> Fetching Node.js binaries
-----> Vendoring node into slug
-----> Installing dependencies with npm
npm ERR! Error: ENOENT, chmod '/tmp/build_1suuxlhd9s8n6/node_modules/express/bin/express'
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <[email protected]>
npm ERR! System Linux 2.6.32-348-ec2
npm ERR! command "/tmp/node-node-tonf/bin/node" "/tmp/node-npm-NG88/cli.js" "rebuild"
npm ERR! cwd /tmp/build_1suuxlhd9s8n6
npm ERR! node -v v0.8.8
npm ERR! npm -v 1.1.65
npm ERR! path /tmp/build_1suuxlhd9s8n6/node_modules/express/bin/express
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /tmp/build_1suuxlhd9s8n6/npm-debug.log
npm ERR! not ok code 0
! Failed to rebuild dependencies with npm
! Heroku push rejected, failed to compile Node.js app
To [email protected]:fast-everglades-2007.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '[email protected]:fast-everglades-2007.git'
tôi cố gắng để tinh chỉnh các phiên bản khác nhau trong package.json của tôi, nhưng không có kết quả. Tôi đang phát triển trên các cửa sổ và nó có thể là vấn đề này ENOENT là do một số vấn đề filemode.
Hãy thử lại. Các kho lưu trữ npm ném các lỗi này đôi khi ngay cả khi bạn chạy từ một môi trường địa phương – almypal
Tôi đã thử nhiều lần liên tiếp đó là lý do tại sao tôi hỏi câu hỏi. Sẽ thử lại ... – insitu