【问题标题】:No webpack.config.js file after using nativescript "tns create my-tab-ng --template tns-template-tab-navigation-ng" template使用 nativescript "tns create my-tab-ng --template tns-template-tab-navigation-ng" 模板后没有 webpack.config.js 文件
【发布时间】:2020-08-20 08:06:24
【问题描述】:
每当我尝试使用连接到我的计算机的设备运行命令tns run android 时,都会发生错误,即找不到webpack.config.js 文件。我使用tns create my-tab-ng --template tns-template-tab-navigation-ng 创建了这个项目。模板不应该创建webpack.config.js 文件吗?请问我做错了什么?
【问题讨论】:
标签:
angular
webpack
nativescript
angular2-nativescript
nativescript-angular
【解决方案1】:
我遇到了完全相同的问题,幸运的是我可以解决它。我希望它也对你有用。
我什至不记得我为什么要设置这个配置,我想我在某个地方读到过它是推荐的,但它确实给我带来了很多痛苦和浪费时间:
用这个检查你的设置:
npm config 获取忽略脚本
如果它返回 true,则将其设置为 false:
npm config set ignore-scripts false
【解决方案2】:
尝试迁移
ng migrate --force
它会为你添加 webpack.config.js