Webpack Error on cordova build | cordova run
See original GitHub issueJust after creating a new project using:
cordova create <project_create_dir> [com.example.projectname] [ProjectClassName] --template cordova-template-framework7-vue-webpack
I did cordova add platform browser
.
After that on running cordova run browser
, I’m getting the following:
`Before deploy hook started… Checking is node modules installed… Node modules already installed. Starting webpack build… Error happened when webpack build: Error: Command failed: “/Users/myuser/Desktop/myproj/node_modules/.bin/webpack”
Webpack build completed to www folder successfully! Error happened on main chain: Error: Error happened when webpack build: Error: Command failed: “/Users/myuser/Desktop/myproj/node_modules/.bin/webpack”
at exec (/Users/myuser/Desktop/myproj/hooks/hookers.js:187:19)
at ChildProcess.exithandler (child_process.js:277:5)
at emitTwo (events.js:125:13)
at ChildProcess.emit (events.js:213:7)
at maybeClose (internal/child_process.js:897:16)
at Socket.stream.socket.on (internal/child_process.js:340:11)
at emitOne (events.js:115:13)
at Socket.emit (events.js:210:7)
at Pipe._handle.close [as _onclose] (net.js:549:12)
Error: Error happened when webpack build: Error: Command failed: “/Users/myuser/Desktop/myproj/node_modules/.bin/webpack”
`
Issue Analytics
- State:
- Created 6 years ago
- Comments:6
Top GitHub Comments
fixed it. npm install was probably using package-lock.json as a reference. It did not have vue and fw7 defined. I removed it and ran npm install again. All required deps got installed and its building successfully now.
I’m not very familiar with the concept of package-lock.json . Not sure if it’s being written incorrectly or was I missing a flag to choose the original package.json while running npm install.
Thanks for your time.
Oh, thanks for response 😃