2016-05-22 8 views
2

Ich benutze Fenstermaschine. Ich möchte, dass meine Web-Spiel zu Heroku laden, aber ich erhalte den folgenden Fehler:"[Fernabgelehnt Master]" -> Master (Pre-Empfangs-Hook abgelehnt)

 E:\node3>git push heroku master 
    Counting objects: 754, done. 
    Delta compression using up to 4 threads. 
    Compressing objects: 100% (687/687), done. 
    Writing objects: 100% (754/754), 3.88 MiB | 313.00 KiB/s, done. 
    Total 754 (delta 220), reused 0 (delta 0) 
    remote: Compressing source files... done. 
    remote: Building source: 
    remote: 
    remote: -----> Node.js app detected 
    remote: 
    remote: -----> Creating runtime environment 
    remote: 
    remote:  NPM_CONFIG_LOGLEVEL=error 
    remote:  NPM_CONFIG_PRODUCTION=true 
    remote:  NODE_ENV=production 
    remote:  NODE_MODULES_CACHE=true 
    remote: 
    remote: -----> Installing binaries 
    remote:  engines.node (package.json): unspecified 
    remote:  engines.npm (package.json): unspecified (use default) 
    remote: 
    remote:  Resolving node version (latest stable) via semver.io... 
    remote:  Downloading and installing node 5.11.1... 
    remote:  Using default npm version: 3.8.6 
    remote: 
    remote: -----> Restoring cache 
    remote:  Skipping cache restore (new runtime signature) 
    remote: 
    remote: -----> Building dependencies 
    remote:  Prebuild detected (node_modules already exists) 
    remote:  Rebuilding any native modules 
    remote:  npm ERR! Linux 3.13.0-85-generic 
    remote:  npm ERR! argv "/tmp/build_396b33dc70a40199869b48acc6cc98f7/.herok 
    u/node/bin/node" "/tmp/build_396b33dc70a40199869b48acc6cc98f7/.heroku/node/bin/n 
    pm" "rebuild" 
    remote:  npm ERR! node v5.11.1 
    remote:  npm ERR! npm v3.8.6 
    remote:  npm ERR! path /tmp/build_396b33dc70a40199869b48acc6cc98f7/node_mo 
    dules/express/node_modules/send/node_modules/mime/cli.js 
    remote:  npm ERR! code ENOENT 
    remote:  npm ERR! errno -2 
    remote:  npm ERR! syscall chmod 
    remote: 
    remote:  npm ERR! enoent ENOENT: no such file or directory, chmod '/tmp/bu 
    ild_396b33dc70a40199869b48acc6cc98f7/node_modules/express/node_modules/send/node 
    _modules/mime/cli.js' 
    remote:  npm ERR! enoent ENOENT: no such file or directory, chmod '/tmp/bu 
    ild_396b33dc70a40199869b48acc6cc98f7/node_modules/express/node_modules/send/node 
    _modules/mime/cli.js' 
    remote:  npm ERR! enoent This is most likely not a problem with npm itself 

    remote:  npm ERR! enoent and is related to npm not being able to find a fi 
    le. 
    remote:  npm ERR! enoent 
    remote: 
    remote:  npm ERR! Please include the following file with any support reque 
    st: 
    remote:  npm ERR!  /tmp/build_396b33dc70a40199869b48acc6cc98f7/npm-debu 
    g.log 
    remote: 
    remote: -----> Build failed 
    remote: 
    remote:  We're sorry this build is failing! You can troubleshoot common is 
    sues here: 
    remote:  https://devcenter.heroku.com/articles/troubleshooting-node-deploy 
    s 
    remote: 
    remote:  Some possible problems: 
    remote: 
    remote:  - node_modules checked into source control 
    remote:  https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-fo 
    lder-into-git 
    remote: 
    remote:  - Node version not specified in package.json 
    remote:  https://devcenter.heroku.com/articles/nodejs-support#specifying-a 
    -node-js-version 
    remote: 
    remote:  Love, 
    remote:  Heroku 
    remote: 
    remote: 
    remote: !  Push rejected, failed to compile Node.js app 
    remote: 
    remote: Verifying deploy... 
    remote: 
    remote: !  Push rejected to iktsl. 
    remote: 
    To https://git.heroku.com/iktsl.git 
    ! [remote rejected] master -> master (pre-receive hook declined) 
    error: failed to push some refs to 'https://git.heroku.com/iktsl.git' 

    E:\node3>git push heroku master 
    Counting objects: 754, done. 
    Delta compression using up to 4 threads. 
    Compressing objects: 100% (687/687), done. 
    Writing objects: 100% (754/754), 3.88 MiB | 322.00 KiB/s, done. 
    Total 754 (delta 220), reused 0 (delta 0) 
    remote: Compressing source files... done. 
    remote: Building source: 
    remote: 
    remote: -----> Node.js app detected 
    remote: 
    remote: -----> Creating runtime environment 
    remote: 
    remote:  NPM_CONFIG_LOGLEVEL=error 
    remote:  NPM_CONFIG_PRODUCTION=true 
    remote:  NODE_ENV=production 
    remote:  NODE_MODULES_CACHE=true 
    remote: 
    remote: -----> Installing binaries 
    remote:  engines.node (package.json): unspecified 
    remote:  engines.npm (package.json): unspecified (use default) 
    remote: 
    remote:  Resolving node version (latest stable) via semver.io... 
    remote:  Downloading and installing node 5.11.1... 
    remote:  Using default npm version: 3.8.6 
    remote: 
    remote: -----> Restoring cache 
    remote:  Skipping cache restore (new runtime signature) 
    remote: 
    remote: -----> Building dependencies 
    remote:  Prebuild detected (node_modules already exists) 
    remote:  Rebuilding any native modules 
    remote:  npm ERR! Linux 3.13.0-85-generic 
    remote:  npm ERR! argv "/tmp/build_373306132b00e684ff5b33e668925804/.herok 
    u/node/bin/node" "/tmp/build_373306132b00e684ff5b33e668925804/.heroku/node/bin/n 
    pm" "rebuild" 
    remote:  npm ERR! node v5.11.1 
    remote:  npm ERR! npm v3.8.6 
    remote:  npm ERR! path /tmp/build_373306132b00e684ff5b33e668925804/node_mo 
    dules/express/node_modules/send/node_modules/mime/cli.js 
    remote:  npm ERR! code ENOENT 
    remote:  npm ERR! errno -2 
    remote:  npm ERR! syscall chmod 
    remote: 
    remote:  npm ERR! enoent ENOENT: no such file or directory, chmod '/tmp/bu 
    ild_373306132b00e684ff5b33e668925804/node_modules/express/node_modules/send/node 
    _modules/mime/cli.js' 
    remote:  npm ERR! enoent ENOENT: no such file or directory, chmod '/tmp/bu 
    ild_373306132b00e684ff5b33e668925804/node_modules/express/node_modules/send/node 
    _modules/mime/cli.js' 
    remote:  npm ERR! enoent This is most likely not a problem with npm itself 

    remote:  npm ERR! enoent and is related to npm not being able to find a fi 
    le. 
    remote:  npm ERR! enoent 
    remote: 
    remote:  npm ERR! Please include the following file with any support reque 
    st: 
    remote:  npm ERR!  /tmp/build_373306132b00e684ff5b33e668925804/npm-debu 
    g.log 
    remote: 
    remote: -----> Build failed 
    remote: 
    remote:  We're sorry this build is failing! You can troubleshoot common is 
    sues here: 
    remote:  https://devcenter.heroku.com/articles/troubleshooting-node-deploy 
    s 
    remote: 
    remote:  Some possible problems: 
    remote: 
    remote:  - node_modules checked into source control 
    remote:  https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-fo 
    lder-into-git 
    remote: 
    remote:  - Node version not specified in package.json 
    remote:  https://devcenter.heroku.com/articles/nodejs-support#specifying-a 
    -node-js-version 
    remote: 
    remote:  Love, 
    remote:  Heroku 
    remote: 
    remote: 
    remote: !  Push rejected, failed to compile Node.js app 
    remote: 
    remote: Verifying deploy... 
    remote: 
    remote: !  Push rejected to iktsl. 
    remote: 
    To https://git.heroku.com/***.git 
    ! [remote rejected] master -> master (pre-receive hook declined) 

Ich weiß, es irgendwie mit node_modules verbunden ist, aber ich kann nicht verstehen, was los ist. Ich werde für jede Hilfe dankbar sein. Vielen Dank.

Mein package.json

{ 
"name": "iktsl", 
"version": "0.0.1", 
"private": true, 
"scripts": { 
    "start": "node app.js" 
}, 
"dependencies": { 
    "express": "4.x", 
    "socket.io": "^1.3.5" 
    } 
} 
+0

'node_modules in die Quellcodeverwaltung eingecheckt 'Haben Sie den Ordner' node_modules' ignoriert? Vielleicht haben Sie das Verzeichnis 'node_modules' in die Quellcodeverwaltung übernommen und es dann verschoben. Wenn Sie dies getan haben, entfernen Sie zuerst das 'node_modules'-Verzeichnis aus dem Repository, dann ignorieren Sie es und drücken Sie Ihre App erneut –

+0

@AliDehghani, können Sie mir bitte sagen, wie" node_modules "zu ignorieren? – Ruben

+0

Zuerst verwenden Sie 'git -r --cached - node_modules 'dann commit die Änderungen und drücken Sie erneut –

Antwort

0

Die Lösung ist node_modules Ordner .gitignore hinzuzufügen. Fügen Sie dazu diese Zeile in der .gitignore-Datei node_modules/ hinzu. Die andere Lösung besteht darin, den Ordner node_modules einfach zu löschen.

Verwandte Themen