expressCart: Product image upload causes app crash for published version
I’ve published the app to windows VM , i can upload product image inside the VM using 127.0.0.1:8080 , but when i access the APP from external computer using IP : 2.23.xx.x.x:8080 , everything works except product image upload , it causes app crash
========================================
Error: ENOENT: no such file or directory, open ‘C:\Apps\ShoppingAPP\public\uploads\af065f578dffbb7ed76c091e0ad937ab’
Emitted ‘error’ event on ReadStream instance at:
at C:\Apps\ShoppingAPP\node_modules\graceful-fs\graceful-fs.js:190:14
at C:\Apps\ShoppingAPP\node_modules\graceful-fs\graceful-fs.js:241:16
at FSReqCallback.oncomplete (fs.js:155:23) {
errno: -4058,
code: ‘ENOENT’,
syscall: ‘open’,
path: ‘C:\Apps\ShoppingAPP\public\uploads\af065f578dffbb7ed76c091e0ad937ab’
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! express-cart@1.1.17 start: node app.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the express-cart@1.1.17 start 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! C:\Users\Administrator\AppData\Roaming\npm-cache_logs\2020-05-08T10_38_35_131Z-debug.log
==================================================
LOG FILE CONTENTS
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli ‘C:\Program Files\nodejs\node.exe’,
1 verbose cli ‘C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js’,
1 verbose cli ‘start’
1 verbose cli ]
2 info using npm@6.14.4
3 info using node@v12.16.2
4 verbose run-script [ ‘prestart’, ‘start’, ‘poststart’ ]
5 info lifecycle express-cart@1.1.17~prestart: express-cart@1.1.17
6 info lifecycle express-cart@1.1.17~start: express-cart@1.1.17
7 verbose lifecycle express-cart@1.1.17~start: unsafe-perm in lifecycle true
8 verbose lifecycle express-cart@1.1.17~start: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Apps\ShoppingAPP\node_modules.bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files\Amazon\cfn-bootstrap;C:\Program Files\nodejs;C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps;C:\Users\Administrator\AppData\Roaming\npm;C:\Users\Administrator\AppData\Local\Programs\Microsoft VS Code\bin;C:\ProgramData\Administrator\GitHubDesktop\bin
9 verbose lifecycle express-cart@1.1.17~start: CWD: C:\Apps\ShoppingAPP
10 silly lifecycle express-cart@1.1.17~start: Args: [ ‘/d /s /c’, ‘node app.js’ ]
11 silly lifecycle express-cart@1.1.17~start: Returned: code: 1 signal: null
12 info lifecycle express-cart@1.1.17~start: Failed to exec start script
13 verbose stack Error: express-cart@1.1.17 start: node app.js
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:310:20)
13 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:310:20)
13 verbose stack at maybeClose (internal/child_process.js:1021:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid express-cart@1.1.17
15 verbose cwd C:\Apps\ShoppingAPP
16 verbose Windows_NT 10.0.17763
17 verbose argv “C:\Program Files\nodejs\node.exe” “C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js” “start”
18 verbose node v12.16.2
19 verbose npm v6.14.4
20 error code ELIFECYCLE
21 error errno 1
22 error express-cart@1.1.17 start: node app.js
22 error Exit status 1
23 error Failed at the express-cart@1.1.17 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 17 (8 by maintainers)
@mrvautin everything else is working , will try to spend sometime on this …
You already have more experience than me running Nodejs on Windows! 😀I’ve not tried it before.
Did you get it working in the end?
Looks like permissions. Make sure the
/uploads
directory can create new files and directories within it.