Как правильно развернуть приложение на сервере геройку? - PullRequest
0 голосов
/ 28 марта 2020

На локальном хосте приложение работает нормально. Хотя мой gitignore файл включает в себя node_modules и /tmp. git push к героку не получается. Это журнал запуска:

git push heroku master
Enumerating objects: 20069, done.
Counting objects: 100% (20069/20069), done.
Delta compression using up to 4 threads
Compressing objects: 100% (13232/13232), done.
Writing objects: 100% (20069/20069), 42.94 MiB | 379.00 KiB/s, done.
Total 20069 (delta 5945), reused 20069 (delta 5945)
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:        NODE_ENV=production
    remote:        NODE_MODULES_CACHE=false
    remote:        NODE_VERBOSE=false
    remote:
    remote: -----> Installing binaries
    remote:        engines.node (package.json):  unspecified
    remote:        engines.npm (package.json):   unspecified (use default)
    remote:
    remote:        Resolving node version 12.x...
    remote:        Downloading and installing node 12.16.1...
    remote:        Using default npm version: 6.13.4
    remote:        
    remote: -----> Restoring cache
    remote:        Caching has been disabled because NODE_MODULES_CACHE=false
    remote:
    remote: -----> Installing dependencies
    remote:        Prebuild detected (node_modules already exists)
    remote:        Rebuilding any native modules
    remote:        
    remote:        > nodemon@1.18.6 postinstall 
    /tmp/build_fe41a85666a59631616201f94292df11/node_modules/nodemon
    remote:        > node bin/postinstall || exit 0
    remote:
    remote:        internal/modules/cjs/loader.js:985
    remote:          throw err;
    remote:          ^
    remote:
    remote:        Error: Cannot find module 
    '/tmp/build_fe41a85666a59631616201f94292df11/node_modules/nodemon/bin/postinstall'
    remote:            at Function.Module._resolveFilename (internal/modules/cjs/loader.js:982:15)      
    remote:            at Function.Module._load (internal/modules/cjs/loader.js:864:27)
    remote:            at Function.executeUserEntryPoint [as runMain] 
    (internal/modules/run_main.js:74:12)
    remote:            at internal/main/run_main_module.js:18:47 {
    remote:          code: 'MODULE_NOT_FOUND',
    remote:          requireStack: []
    remote:        }
    remote:        npm ERR! code ENOENT
    remote:        npm ERR! syscall chmod
    remote:        npm ERR! path /tmp/build_fe41a85666a59631616201f94292df11/node_modules/rc/cli.js     
    remote:        npm ERR! errno -2
    remote:        npm ERR! enoent ENOENT: no such file or directory, chmod 
    '/tmp/build_fe41a85666a59631616201f94292df11/node_modules/rc/cli.js'
    remote:        npm ERR! enoent This is related to npm not being able to find a file.
    remote:        npm ERR! enoent
    remote:        
    remote:        npm ERR! A complete log of this run can be found in:
    remote:        npm ERR!     /tmp/npmcache.JfAxp/_logs/2020-03-28T09_56_18_992Z-debug.log
    remote:
    remote: -----> Build failed
    remote:        
    remote:        We're sorry this build is failing! You can troubleshoot common issues here:
    remote:        https://devcenter.heroku.com/articles/troubleshooting-node-deploys
    remote:
     remote:        Some possible problems:
    remote:
    remote:        - node_modules checked into source control
    remote:          https://blog.heroku.com/node-habits-2016#9-only-git-the-important-bits
    remote:
    remote:        - Node version not specified in package.json
    remote:          https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version  
    remote:
    remote:        - A module may be missing from 'dependencies' in package.json
    remote:          https://devcenter.heroku.com/articles/troubleshooting-node-deploys#ensure-you-aren- 
         t-relying-on-untracked-dependencies
    remote:
    remote:        Love,
    remote:        Heroku

Буду признателен, если кто-нибудь может помочь с этим. Спасибо

This is content of .gitignore file:
# ignore all files in node_modules directory
 node_modules
 /tmp
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...