direflow icon indicating copy to clipboard operation
direflow copied to clipboard

Unable to run "npm run build:lib" command

Open assignments-tataaig opened this issue 5 years ago • 10 comments

Describe the bug
A clear and concise description of what the bug is.

To reproduce
Steps to reproduce the behavior:

  1. Build web-component using npx direflow-cli create command
  2. Once command is created run "npm run build:lib" command it will throw below error

"Building React component library... events.js:292 throw er; // Unhandled 'error' event ^ "

Expected behavior
Should have created folder lib with React components.

Package Manager:
To install Direflow, I used npm

assignments-tataaig avatar Jul 30 '20 15:07 assignments-tataaig

Thanks for creating this bug. We'll investigate :+1:

SimonHoiberg avatar Jul 30 '20 17:07 SimonHoiberg

Hi @assignments-tataaig I haven't been able to reproduce this bug. Can you provide some more context?

  • Are you using TypeScript or JavaScript
  • Does the file component-exports.js correctly exist in src folder?
  • Does it correctly export the components you want to include?
  • What happens if you install direflow globally instead of using npx?

Thank you.

SimonHoiberg avatar Aug 13 '20 09:08 SimonHoiberg

Hi! I'm having the same problem. I just ran "direflow create" on an empty project folder and I'm having the same issue. here is my configuration:

Are you using TypeScript or JavaScript : Typescript Does the file component-exports.js correctly exist in src folder? There is a typescript one inside source folder (src/component-exports.ts) Does it correctly export the components you want to include? It's bascally exporting the default App component What happens if you install direflow globally instead of using npx? I installed it via global direflow-cli command

I'm running Windows 10 (v2004) Professional x64. with visual studio code IDE.

Console output:

$direflow create ? Choose a name for your Direflow Setup: df35 ? Give your Direflow Setup a description (optional) ? Which language do you want to use? TypeScript ? Which linter do you want to use? ESLint ? Do you want this to be an NPM module? Yes

$cd .\df35-component\ $npm install $npm start (Working) $npm run build (Working) $npm run build:lib (NOT WORKING)

[email protected] build:lib C:\Users\RomaneDonnet\Desktop\direflow35\df35-component direflow-scripts build:lib

Building React component library... events.js:174 throw er; // Unhandled 'error' event ^

Error: spawn webpack ENOENT at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19) at onErrorNT (internal/child_process.js:415:16) at process._tickCallback (internal/process/next_tick.js:63:19) at Function.Module.runMain (internal/modules/cjs/loader.js:757:11) at startup (internal/bootstrap/node.js:283:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3) Emitted 'error' event at: at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12) at onErrorNT (internal/child_process.js:415:16) [... lines matching original stack trace ...] at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] build:lib: direflow-scripts build:lib npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] build:lib 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\RomaneDonnet\AppData\Roaming\npm-cache_logs\2020-08-27T13_04_50_702Z-debug.log

Complete log

0 info it worked if it ends with ok 1 verbose cli [ 'C:\Program Files\nodejs\node.exe', 1 verbose cli 'C:\Users\RomaneDonnet\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js', 1 verbose cli 'run', 1 verbose cli 'build:lib' ] 2 info using [email protected] 3 info using [email protected] 4 verbose run-script [ 'prebuild:lib', 'build:lib', 'postbuild:lib' ] 5 info lifecycle [email protected]~prebuild:lib: [email protected] 6 info lifecycle [email protected]~build:lib: [email protected] 7 verbose lifecycle [email protected]~build:lib: unsafe-perm in lifecycle true 8 verbose lifecycle [email protected]~build:lib: PATH: C:\Users\RomaneDonnet\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\RomaneDonnet\Desktop\direflow35\df35-component\node_modules.bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files\dotnet;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Microsoft Emulator Manager\1.0;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit;C:\Program Files (x86)\Windows Kits\10\Microsoft Application Virtualization\Sequencer;C:\Program Files\nodejs;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files (x86)\Yarn\bin;C:\Program Files\Microsoft\Web Platform Installer;C:\Program Files\PuTTY;C:\Program Files\Git\cmd;C:\Ruby26-x64\bin;C:\Ruby23-x64\bin;C:\RailsInstaller\Ruby2.2.0\bin;C:\Users\RomaneDonnet\AppData\Local\Programs\Python\Python37-32\Scripts;C:\Users\RomaneDonnet\AppData\Local\Programs\Python\Python37-32;C:\Users\RomaneDonnet\AppData\Local\Microsoft\WindowsApps;;C:\Users\RomaneDonnet\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\RomaneDonnet\AppData\Roaming\npm;C:\Program Files\JetBrains\WebStorm 2019.1\bin;;C:\Users\RomaneDonnet\AppData\Local\Yarn\bin;C:\Users\RomaneDonnet.dotnet\tools 9 verbose lifecycle [email protected]~build:lib: CWD: C:\Users\RomaneDonnet\Desktop\direflow35\df35-component 10 silly lifecycle [email protected]~build:lib: Args: [ '/d /s /c', 'direflow-scripts build:lib' ] 11 silly lifecycle [email protected]~build:lib: Returned: code: 1 signal: null 12 info lifecycle [email protected]~build:lib: Failed to exec build:lib script 13 verbose stack Error: [email protected] build:lib: direflow-scripts build:lib 13 verbose stack Exit status 1 13 verbose stack at EventEmitter. (C:\Users\RomaneDonnet\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16) 13 verbose stack at EventEmitter.emit (events.js:189:13) 13 verbose stack at ChildProcess. (C:\Users\RomaneDonnet\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14) 13 verbose stack at ChildProcess.emit (events.js:189:13) 13 verbose stack at maybeClose (internal/child_process.js:970:16) 13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5) 14 verbose pkgid [email protected] 15 verbose cwd C:\Users\RomaneDonnet\Desktop\direflow35\df35-component 16 verbose Windows_NT 10.0.19041 17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Users\RomaneDonnet\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "run" "build:lib" 18 verbose node v10.15.3 19 verbose npm v6.14.2 20 error code ELIFECYCLE 21 error errno 1 22 error [email protected] build:lib: direflow-scripts build:lib 22 error Exit status 1 23 error Failed at the [email protected] build:lib script. 23 error This is probably not a problem with npm. There is likely additional logging output above. 24 verbose exit [ 1, true ]

romane-echino avatar Aug 27 '20 13:08 romane-echino

Thanks a lot, @romane-echino :+1: This helps a lot. It seems to be an issue with Webpack on Windows. We'll look into this as soon as possible!

SimonHoiberg avatar Aug 29 '20 20:08 SimonHoiberg

Any updates? Sorry for disturbing

romane-echino avatar Sep 18 '20 15:09 romane-echino

Same issue here. Any updates/workarounds?

GrzegorzKapciaKrk avatar Nov 01 '20 19:11 GrzegorzKapciaKrk

Any updates on this? 2 of my team members are also facing same issue.

vjhbtigoyal avatar Jan 08 '21 07:01 vjhbtigoyal

Same issue with either Javascript or Typescript

dalopezarco avatar Feb 11 '21 14:02 dalopezarco

Thanks a lot, @romane-echino 👍 This helps a lot. It seems to be an issue with Webpack on Windows. We'll look into this as soon as possible!

It is true that has to be something with Windows only, I Installed Windows Subsystem for Linux, and run the script from the Ubuntu console and it worked.

dalopezarco avatar Feb 11 '21 18:02 dalopezarco

This may help to resolve this issue. https://github.com/facebook/create-react-app/issues/9455

vijay-kumar-singh avatar Mar 01 '22 12:03 vijay-kumar-singh