monaca / monaca-cli

Command line version of Monaca
Other
44 stars 14 forks source link

Unable to run monaca preview on monaca 2.4.4 #117

Closed hanaokaiwa closed 7 years ago

hanaokaiwa commented 7 years ago

I updated to monaca 2.4.4 today and I cannot run monaca preview anymore. Here is the output of console: $ monaca preview { Error: Cannot find module '/mnt/program/monaca/sample4-13/package.json' 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 /home/daniel/node_modules/monaca/src/serve.js:13:21 at Object. (/home/daniel/node_modules/monaca/src/serve.js:155:3) 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) at Module.require (module.js:497:17) at require (internal/module.js:20:19) at runner (/home/daniel/node_modules/monaca/src/monaca.js:113:21) at Object.run (/home/daniel/node_modules/monaca/src/monaca.js:120:5) at Object. (/home/daniel/node_modules/monaca/bin/monaca:12:9) code: 'MODULE_NOT_FOUND' }

I could preview this project before the update of monaca.

andipavllo commented 7 years ago

@hanaokaiwa does it work if you run the command in the project root directory?

andipavllo commented 7 years ago

I just released CLI 2.4.5 with a fix, please notice that you can run monaca preview | serve | transpile | demo only in the project root directory. We will fix this in the next release.

hanaokaiwa commented 7 years ago

Thank you very much for release of version 2.4.5. I confirmed this bug has been fixed on version 2.4.5.