y@ty-Virtual-Machine:~/work/mmpayxdclog$ sudo npm run dev
[sudo] ty 的密码:
> mmpayxdcnodejskoa@1.0.0 dev /home/ty/work/mmpayxdclog
> cross-env RUN_ENV=dev nodemon scripts/serve.js
sh: 1: cross-env: Permission denied
npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! mmpayxdcnodejskoa@1.0.0 dev: `cross-env RUN_ENV=dev nodemon scripts/serve.js`
npm ERR! Exit status 126
npm ERR!
npm ERR! Failed at the mmpayxdcnodejskoa@1.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-07-13T05_40_55_222Z-debug.log
解决办法:
ty@ty-Virtual-Machine:~/work/mmpayxdclog$ sudo chmod -R a+x node_modules
再重新运行
ty@ty-Virtual-Machine:~/work/mmpayxdclog$ sudo npm run dev
> mmpayxdcnodejskoa@1.0.0 dev /home/ty/work/mmpayxdclog
> cross-env RUN_ENV=dev nodemon scripts/serve.js
[nodemon] 2.0.6
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `node scripts/serve.js`
process.uncaughtException process will exit with 1000 5809 Error: Cannot find module '../config/config_oringal1'
Require stack:
- /home/ty/work/mmpayxdclog/models/cluster.js
- /home/ty/work/mmpayxdclog/models/search.js
- /home/ty/work/mmpayxdclog/controllers/mmpay_plog_api/search/index.js
- /home/ty/work/mmpayxdclog/controllers/mmpay_plog_api/index.js
- /home/ty/work/mmpayxdclog/router.js
- /home/ty/work/mmpayxdclog/app.js
- /home/ty/work/mmpayxdclog/scripts/serve.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
at Function.Module._load (internal/modules/cjs/loader.js:746:27)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:92:18)
at Object.<anonymous> (/home/ty/work/mmpayxdclog/models/cluster.js:2:16)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:14)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:92:18)
at Object.<anonymous> (/home/ty/work/mmpayxdclog/models/search.js:2:17)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:14)