savoygu / blog Goto Github PK
View Code? Open in Web Editor NEW面试、前端、Node.js、博客
面试、前端、Node.js、博客
本地package.json文件都有这些模块,但是拉去代码到服务器之后执行deploy就报这个错误,到服务器端到production文件夹去看时没问题的
--> Deploying to production environment --> on host 39.105.73.230 fatal: no upstream configured for branch 'master' ○ deploying origin/master ○ executing pre-deploy-local ○ hook pre-deploy ○ fetching updates ○ full fetch Fetching origin ○ resetting HEAD to origin/master HEAD is now at c22d75d fix ○ executing post-deploy
export NODE_ENV=production && cnpm install && node build/build.js && pm2 startOrRestartecosystem.json --env production`
[1/15] fastclick@^1.0.6 installed at node_modules/_fastclick@1.0.6@fastclick
[2/15] lyric-parser@^1.0.1 installed at node_modules/_lyric-parser@1.0.1@lyric-parser
[3/15] js-base64@^2.1.9 installed at node_modules/[email protected]@js-base64
[4/15] jsonp@^0.2.1 installed at node_modules/_jsonp@0.2.1@jsonp
[5/15] good-storage@^1.0.1 installed at node_modules/_good-storage@1.0.1@good-storage
[6/15] vue-lazyload@^1.0.5 installed at node_modules/_vue-lazyload@1.2.6@vue-lazyload
[7/15] axios@^0.16.2 installed at node_modules/_axios@0.16.2@axios
[8/15] better-scroll@^0.4.0 installed at node_modules/_better-scroll@0.4.0@better-scroll
[9/15] vue-router@^2.3.1 installed at node_modules/_vue-router@2.8.1@vue-router
[10/15] socks@^2.2.1 installed at node_modules/_socks@2.2.1@socks
[11/15] vuex@^2.3.1 installed at node_modules/_vuex@2.5.0@vuex
[12/15] vue@^2.3.3 installed at node_modules/_vue@2.5.17@vue
[13/15] create-keyframe-animation@^0.1.0 installed at node_modules/_create-keyframe-animation@0.1.0@create-keyframe-animation
[14/15] babel-runtime@^6.23.0 installed at node_modules/_babel-runtime@6.26.0@babel-runtime
[15/15] babel-polyfill@^6.23.0 installed at node_modules/_babel-polyfill@6.26.0@babel-polyfill
Recently updated (since 2018-07-28): 2 packages (detail see file /home/zsz_user/www/website/production/source/node_modules/.recently_updates.txt)
2018-08-02
→ [email protected] › follow-redirects@^1.2.3(1.5.2) (02:34:57)
→ vue@^2.3.3(2.5.17) (03:31:34)
All packages installed (42 packages installed from npm registry, used 2s(network 2s), speed 1.58MB/s, json 40(387.09kB), tarball 2.18MB)
module.js:471
throw err;
^
Error: Cannot find module 'chalk'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/home/zsz_user/www/website/production/source/build/check-versions.js:1:75)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
post-deploy hook failed
Deploy failed`
{ "apps":[ { "name":"dmovie", //项目名称 "script":"server.js", //入口文件 "env":{ "COMMON_VARIABLE": "true" }, "env_production" : { "NODE_ENV": "production" } } ], "deploy":{ "production":{ "user":"dwr", // 服务器登录用户名 "host":["39.97.105.210"], //服务器ip "port":"22", //ssh 端口如果没改过为 22 "ref":"origin/master", "repo":"[email protected]:d34skip/dmovie.git", //git仓库 项目ssh地址 "path":"/www/dmovie/production",//服务器部署地址 需要事先在服务器上将/www/website/ 新建出来 "ssh_options":"StrictHostKeyChecking=no", "env":{ "NODE_ENV":"production" } } } }
ecosystem.json 的代码
服务器上直接git clone 也可以直接拉下来
但是执行pm2 deploy ecosystem.json production setup的时候就会报错
--> Deploying to production environment
--> on host 39.97.105.210
○ hook pre-setup
○ running setup
○ cloning [email protected]:d34skip/dmovie.git
○ full fetch
Cloning into '/www/dmovie/production/source'...
/www/dmovie/production/source/.git: Permission denied
failed to clone
Deploy failed
1
服务器的目录也是~/www/dmovie
目录也给了权限
请问这个错怎么解决
5.7
你好,我在执行数据库定时备份七牛的时候遇到问题,node: not found,之前成功过七牛上有上传成功的文件,但是现在又失败了
NODE_ENV=$backUpFolder@$backFileName node /home/tanya/tasks/upload.js
我跟着网上查到的方法
ls -l /usr/local/bin | grep node, node是不存在的,然后手动创建了
ln -s /Users/#{username}/.nvm/#{nodeVersion}/bin/node /usr/local/bin/node
但是还是不能 node: not found
求助,谢谢
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.