Mancy icon indicating copy to clipboard operation
Mancy copied to clipboard

Not download npm automaticly

Open cloudqq opened this issue 9 years ago • 10 comments

let moment = require('moment');

Error: Cannot find module 'moment'

I think it will download the npm package automaticly, is it a BUG?

cloudqq avatar May 26 '16 05:05 cloudqq

I'll test it once I have access to my machine

princejwesley avatar May 26 '16 05:05 princejwesley

@cloudqq It works fine for me. Can you increase execution timeout preferences and try again?

princejwesley avatar May 27 '16 00:05 princejwesley

I've adjusted the "excution Timout“ to 600000, but nothing happened. How to enable debug log?

cloudqq avatar May 27 '16 02:05 cloudqq

@cloudqq Got same error? Can you join in gitter to discuss further?

Run with --debug flag to enable developer tool View > Toggle Developer Tools

mancy . --debug

princejwesley avatar May 27 '16 02:05 princejwesley

Automatic download path
Platform Download Path
Windows C:\Users%USERNAME%\AppData\Local\mancy\node_modules
OS X  ~/Library/Application Support/mancy/node_modules
Linux  ~/.config/mancy/node_modules

princejwesley avatar May 27 '16 02:05 princejwesley

it doesn't download on demand on my machine too.

require('whatwg-fetch')

Error:  Cannot find module 'whatwg-fetch'
  at Function.Module._resolveFilename (module.js:338:15)
  at Module._load (module.js:289:25)
  at Function._module3.default._load (/Users/fibric/Applications/Mancy.app/Contents/Resources/app/common/ReplContext.js:117:14)
  at Module.require (module.js:366:17)
  at require (module.js:385:17)
  at mancy-repl:1:1
  at ContextifyScript.cxt.runInContext (/Users/fibric/Applications/Mancy.app/Contents/Resources/app/common/ReplContext.js:203:18)
  at Object.runInContext (/Users/fibric/Applications/Mancy.app/Contents/Resources/app/common/ReplCommon.js:427:23)
  at ReplActiveInput.transpileAndExecute (/Users/fibric/Applications/Mancy.app/Contents/Resources/app/components/ReplActiveInput.js:678:32)
  at /Users/fibric/Applications/Mancy.app/Contents/Resources/app/components/ReplActiveInput.js:843:20

I had to install it manually. Maybe it doesn't install because node_modules doesn't exist.

# fibric @ fibrics-Mac-Pro in ~/Library/Application Support/mancy [2:04:58]
$ ls
DevTools Extensions GPUCache            Local Storage

# fibric @ fibrics-Mac-Pro in ~/Library/Application Support/mancy [2:04:59]
$ npm i whatwg-fetch
/Users/fibric/Library/Application Support/mancy
└── [email protected]

npm WARN enoent ENOENT: no such file or directory, open '/Users/fibric/Library/Application Support/mancy/package.json'
npm WARN mancy No description
npm WARN mancy No repository field.
npm WARN mancy No README data
npm WARN mancy No license field.

require('whatwg-fetch'); Object {} __proto__ : Object {}

ghost avatar May 31 '16 00:05 ghost

@fibric can you try adding below log and debug here ?

console.log('request' , request, 'paths', parent.path, 'path', path)
console.log(ex)

princejwesley avatar May 31 '16 01:05 princejwesley

@princejwesley In debug mode it downloads automatically without any error. I had this error only once after packaging an OSX build, but this electron build doesn't open the devTools. Don't see the log outputs, nothing logged in console.app.

ghost avatar May 31 '16 04:05 ghost

@fibric context.console.log logs to application. we have to pass --debug flag to enable chrome dev tool.

Mancy 🙈 ₹ git:(master) dist/Mancy-darwin-x64/Mancy.app/Contents/MacOS/Electron . --debug

princejwesley avatar May 31 '16 04:05 princejwesley

I had this happen to me too.

I didn't have a node_modules folder inside " ~/Library/Application Support/mancy/node_modules". Once I created it everything started working fine. I guess it just expects the folder to exist.

bunea avatar Jul 07 '16 10:07 bunea