question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"npm run dist" can NOT work !

See original GitHub issue

Expected Behavior

“npm start” is OK, When I run “npm run dist” ,got error like this:

` + 1 hidden module

scratch-desktop@3.14.0 fetch E:\steam\scratch\scratch_git\scratch3\scratch-desktop
rimraf ./static/assets/ && mkdirp ./static/assets/ && node ./scripts/fetchMediaLibraryAssets.js

Total library assets: 1331
events.js:292
throw er; // Unhandled ‘error’ event
^

Error: connect ETIMEDOUT 31.13.77.33:443
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16)
Emitted ‘error’ event on ClientRequest instance at:
at TLSSocket.socketErrorListener (_http_client.js:426:9)
at TLSSocket.emit (events.js:315:20)
at emitErrorNT (internal/streams/destroy.js:92:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
errno: ‘ETIMEDOUT’,
code: ‘ETIMEDOUT’,
syscall: ‘connect’,
address: ‘31.13.77.33’,
port: 443
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! scratch-desktop@3.14.0 fetch: rimraf ./static/assets/ && mkdirp ./static/assets/ && node ./scripts/fetchMed iaLibraryAssets.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the scratch-desktop@3.14.0 fetch 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\mkygogo\AppData\Roaming\npm-cache_logs\2020-08-18T12_06_07_808Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! scratch-desktop@3.14.0 dist: npm run clean && npm run compile && npm run fetch && npm run doBuild -- --mode =dist
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the scratch-desktop@3.14.0 dist 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\mkygogo\AppData\Roaming\npm-cache_logs\2020-08-18T12_06_07_856Z-debug.log
`

and the two log files:

### 2020-08-18T12_06_07_808Z-debug.log:

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 ‘run’, 1 verbose cli ‘fetch’ 1 verbose cli ] 2 info using npm@6.14.6 3 info using node@v12.18.3 4 verbose run-script [ ‘prefetch’, ‘fetch’, ‘postfetch’ ] 5 info lifecycle scratch-desktop@3.14.0~prefetch: scratch-desktop@3.14.0 6 info lifecycle scratch-desktop@3.14.0~fetch: scratch-desktop@3.14.0 7 verbose lifecycle scratch-desktop@3.14.0~fetch: unsafe-perm in lifecycle true 8 verbose lifecycle scratch-desktop@3.14.0~fetch: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;E:\steam\scratch\scratch_git\scratch3\scratch-desktop\node_modules.bin;C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;E:\steam\scratch\scratch_git\scratch3\scratch-desktop\node_modules.bin;E:\steam\scratch\scratch_git\cmder\vendor\bin;E:\steam\scratch\scratch_git\cmder\vendor\git-for-windows\cmd;E:\steam\scratch\scratch_git\cmder\vendor\conemu-maximus5\ConEmu\Scripts;E:\steam\scratch\scratch_git\cmder\vendor\conemu-maximus5;E:\steam\scratch\scratch_git\cmder\vendor\conemu-maximus5\ConEmu;C:\Python38\Scripts;C:\Python38;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files\nodejs;C:\ProgramData\chocolatey\bin;C:\Users\mkygogo\AppData\Local\Microsoft\WindowsApps;C:\Users\mkygogo\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\mkygogo\AppData\Roaming\npm;E:\steam\scratch\scratch_git\cmder\vendor\git-for-windows\mingw64\bin;E:\steam\scratch\scratch_git\cmder\vendor\git-for-windows\usr\bin;E:\steam\scratch\scratch_git\cmder 9 verbose lifecycle scratch-desktop@3.14.0~fetch: CWD: E:\steam\scratch\scratch_git\scratch3\scratch-desktop 10 silly lifecycle scratch-desktop@3.14.0~fetch: Args: [ 10 silly lifecycle ‘/d /s /c’, 10 silly lifecycle ‘rimraf ./static/assets/ && mkdirp ./static/assets/ && node ./scripts/fetchMediaLibraryAssets.js’ 10 silly lifecycle ] 11 silly lifecycle scratch-desktop@3.14.0~fetch: Returned: code: 1 signal: null 12 info lifecycle scratch-desktop@3.14.0~fetch: Failed to exec fetch script 13 verbose stack Error: scratch-desktop@3.14.0 fetch: rimraf ./static/assets/ && mkdirp ./static/assets/ && node ./scripts/fetchMediaLibraryAssets.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:315: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:315: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 scratch-desktop@3.14.0 15 verbose cwd E:\steam\scratch\scratch_git\scratch3\scratch-desktop 16 verbose Windows_NT 10.0.18362 17 verbose argv “C:\Program Files\nodejs\node.exe” “C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js” “run” “fetch” 18 verbose node v12.18.3 19 verbose npm v6.14.6 20 error code ELIFECYCLE 21 error errno 1 22 error scratch-desktop@3.14.0 fetch: rimraf ./static/assets/ && mkdirp ./static/assets/ && node ./scripts/fetchMediaLibraryAssets.js 22 error Exit status 1 23 error Failed at the scratch-desktop@3.14.0 fetch script. 23 error This is probably not a problem with npm. There is likely additional logging output above. 24 verbose exit [ 1, true ]

### 2020-08-18T12_06_07_856Z-debug.log

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 ‘run’, 1 verbose cli ‘dist’ 1 verbose cli ] 2 info using npm@6.14.6 3 info using node@v12.18.3 4 verbose run-script [ ‘predist’, ‘dist’, ‘postdist’ ] 5 info lifecycle scratch-desktop@3.14.0~predist: scratch-desktop@3.14.0 6 info lifecycle scratch-desktop@3.14.0~dist: scratch-desktop@3.14.0 7 verbose lifecycle scratch-desktop@3.14.0~dist: unsafe-perm in lifecycle true 8 verbose lifecycle scratch-desktop@3.14.0~dist: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;E:\steam\scratch\scratch_git\scratch3\scratch-desktop\node_modules.bin;E:\steam\scratch\scratch_git\cmder\vendor\bin;E:\steam\scratch\scratch_git\cmder\vendor\git-for-windows\cmd;E:\steam\scratch\scratch_git\cmder\vendor\conemu-maximus5\ConEmu\Scripts;E:\steam\scratch\scratch_git\cmder\vendor\conemu-maximus5;E:\steam\scratch\scratch_git\cmder\vendor\conemu-maximus5\ConEmu;C:\Python38\Scripts;C:\Python38;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files\nodejs;C:\ProgramData\chocolatey\bin;C:\Users\mkygogo\AppData\Local\Microsoft\WindowsApps;C:\Users\mkygogo\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\mkygogo\AppData\Roaming\npm;E:\steam\scratch\scratch_git\cmder\vendor\git-for-windows\mingw64\bin;E:\steam\scratch\scratch_git\cmder\vendor\git-for-windows\usr\bin;E:\steam\scratch\scratch_git\cmder 9 verbose lifecycle scratch-desktop@3.14.0~dist: CWD: E:\steam\scratch\scratch_git\scratch3\scratch-desktop 10 silly lifecycle scratch-desktop@3.14.0~dist: Args: [ 10 silly lifecycle ‘/d /s /c’, 10 silly lifecycle ‘npm run clean && npm run compile && npm run fetch && npm run doBuild – --mode=dist’ 10 silly lifecycle ] 11 silly lifecycle scratch-desktop@3.14.0~dist: Returned: code: 1 signal: null 12 info lifecycle scratch-desktop@3.14.0~dist: Failed to exec dist script 13 verbose stack Error: scratch-desktop@3.14.0 dist: npm run clean && npm run compile && npm run fetch && npm run doBuild -- --mode=dist 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:315: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:315: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 scratch-desktop@3.14.0 15 verbose cwd E:\steam\scratch\scratch_git\scratch3\scratch-desktop 16 verbose Windows_NT 10.0.18362 17 verbose argv “C:\Program Files\nodejs\node.exe” “C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js” “run” “dist” 18 verbose node v12.18.3 19 verbose npm v6.14.6 20 error code ELIFECYCLE 21 error errno 1 22 error scratch-desktop@3.14.0 dist: npm run clean && npm run compile && npm run fetch && npm run doBuild -- --mode=dist 22 error Exit status 1 23 error Failed at the scratch-desktop@3.14.0 dist script. 23 error This is probably not a problem with npm. There is likely additional logging output above. 24 verbose exit [ 1, true ]

Operating System and Browser

Windows 10

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
apple502jcommented, Aug 18, 2020

If you can, try proxy or VPN. This is probably the result of China government blocking Scratch.

0reactions
cwillisfcommented, Sep 29, 2020

See also #153

Read more comments on GitHub >

github_iconTop Results From Across the Web

problem with "npm run dist" when using electron-builder
I noticed you don't have a directories object in your package.json . I don't know if it's vital because I can't interpret the...
Read more >
npm run dist in windows with error · Issue #11902 - GitHub
The dist script isn't going to work as written on Windows – because scripts are run with cmd.exe on Windows the NODE_ENV=production part...
Read more >
Common errors | npm Docs
Some strange issues can be resolved by simply running npm cache clean and trying again. If you are having trouble with npm install...
Read more >
Build tools - Bootstrap
Should you encounter problems with installing dependencies, uninstall all previous dependency versions (global and local). Then, rerun npm install .
Read more >
Npm run build does not include three.js dependencies
js dependencies are not being included from the “node_modules” folder, but directly including the three folders to dist doesn't fix my issue on ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found