NativeScript / nativescript-cli

Command-line interface for building NativeScript apps
https://www.npmjs.com/package/nativescript
Apache License 2.0
1.04k stars 195 forks source link

webpack.config.js does not exist #5731

Closed vallemar closed 1 year ago

vallemar commented 1 year ago

Issue Description

I have a new project and when run ns run android I have this error:

The webpack configuration file /xxxx/ns-bank-cards/webpack.config.js does not exist. Ensure the file exists, or update the path in nativescript.config.(js|ts).

I am using the new cli nativescript@8.5.3

vallemar@macbook-pro-de-juan bank-cards % ns -v
8.5.3
✔ Up to date.

Environment

OS: macOS 13.3
CPU: (12) arm64 Apple M2 Max
Shell: /bin/zsh
node: 18.14.0
npm: 9.3.1
nativescript: 8.5.3

# android
java: 11.0.18
ndk: Not Found
apis: Not Found
build_tools: Not Found
system_images: Not Found

# ios
xcode: 14.3/14E222b
cocoapods: 1.11.3
python: 3.10.10
python3: 3.10.10
ruby: 2.7.7
platforms: 
  - DriverKit 22.4
  - iOS 16.4
  - macOS 13.3
  - tvOS 16.4
  - watchOS 9.4

Dependencies

"dependencies": {
  "@nativescript/core": "^8.5.0",
  "nativescript-vue": "3.0.0-beta.5"
},
"devDependencies": {
  "@nativescript-dom/core-types": "^1.0.25",
  "@nativescript-dom/vue-types": "^1.0.14",
  "@nativescript/android": "8.5.0",
  "@nativescript/tailwind": "^2.0.1",
  "@nativescript/types": "~8.4.0",
  "@nativescript/webpack": "~5.0.0",
  "@types/node": "~17.0.21",
  "tailwindcss": "^3.1.8",
  "typescript": "~4.8.4",
  "vue": "^3.2.45"
}

Please accept these terms

vallemar commented 1 year ago

I see that this problem continue in 8.5.3 https://github.com/NativeScript/nativescript-cli/issues/5727

alexander-mai commented 1 year ago

The Probelem is fixed in Version 8.5.3 @vallemar. https://github.com/NativeScript/nativescript-cli/issues/5727#issuecomment-1505700726

vallemar commented 1 year ago

for me the problem persists having version 8.5.3 with vue3 simple project

alexander-mai commented 1 year ago

Have you checkd the installed Version on nativescript with ns -v? You can upgrade with npm i -g nativescript.

After the upgrade I tried to create a new project with ns create example-project --angular and the file webpack.config.js was created.

rigor789 commented 1 year ago

@vallemar the creation happens when you do ns create so if you created the project on 8.5.2 a new config will not be created automatically when running with 8.5.3. You can create/init one with ./node_modules/.bin/nativescript-webpack init though there are a few other things the after-createProject hook does, that it's better to create a new project and copy code over.

vallemar commented 1 year ago

@rigor789 This makes sense, I think that was just the case. I created the project and realized the update and updated the cli. Ok then I close the problem. Thanks

@alexander-mai Thanks to you too for the help.