我正在创建我的第一个角度电子项目,这是我的错误日志我试图在我的角度4项目中添加新的字体和样式
我已从项目中删除了bootstrap,因为style.css包含所有的boostrap代码和我的个人css
多个./node_modules/MicroFinanceAssets/css/style.css模块中的错误 找不到:错误:无法解决 ' /home/deck/Documents/project/MicroFinance/UI/angular-electron-master/node_modules/MicroFinanceAssets/css/style.css' 在 ' /家庭/甲板/文件/项目/小额/ UI /角电子主/ node_modules / @角/ CLI /模型/的WebPack-CONFIGS' 解决 ' /home/deck/Documents/project/MicroFinance/UI/angular-electron-master/node_modules/MicroFinanceAssets/css/style.css' 在 ' /家庭/甲板/文件/项目/小额/ UI /角电子主/ node_modules / @角/ CLI /模型/的WebPack-CONFIGS' 使用描述文件: /home/deck/Documents/project/MicroFinance/UI/angular-electron-master/node_modules/@angular/cli/package.json (相对路径:./ model /webpack-configs) Field'浏览器'使用描述文件后,不包含有效的别名配置: /home/deck/Documents/project/MicroFinance/UI/angular-electron-master/node_modules/@angular/cli/package.json (相对路径:./ model /webpack-configs) 使用描述文件:/home/deck/Documents/project/MicroFinance/UI/angular-electron-master/package.json (相对路径:./ node_modules/MicroFinanceAssets/css/style.css) 没有延期 Field'浏览器'不包含有效的别名配置 /home/deck/Documents/project/MicroFinance/UI/angular-electron-master/node_modules/MicroFinanceAssets/css/style.css 不存在 .TS Field'浏览器'不包含有效的别名配置 /home/deck/Documents/project/MicroFinance/UI/angular-electron-master/node_modules/MicroFinanceAssets/css/style.css.ts 不存在 .js文件 Field'浏览器'不包含有效的别名配置 /home/deck/Documents/project/MicroFinance/UI/angular-electron-master/node_modules/MicroFinanceAssets/css/style.css.js 不存在 作为目录 /home/deck/Documents/project/MicroFinance/UI/angular-electron-master/node_modules/MicroFinanceAssets/css/style.css 不存在 [/home/deck/Documents/project/MicroFinance/UI/angular-electron-master/node_modules/MicroFinanceAssets/css/style.css] [/home/deck/Documents/project/MicroFinance/UI/angular-electron-master/node_modules/MicroFinanceAssets/css/style.css.ts] [/home/deck/Documents/project/MicroFinance/UI/angular-electron-master/node_modules/MicroFinanceAssets/css/style.css.js] [/home/deck/Documents/project/MicroFinance/UI/angular-electron-master/node_modules/MicroFinanceAssets/css/style.css] @ multi ./node_modules/MicroFinanceAssets/css/style.css npm ERR!码 ELIFECYCLE npm ERR!错误1 npm ERR! angular-electron@0.0.0 build:
ng build
npm ERR!退出状态1 npm ERR!错误的ERR!失败了 angular-electron@0.0.0构建脚本。错误的ERR!这可能不是一个 npm的问题。上面可能有额外的日志记录输出。npm ERR!可以在以下位置找到此运行的完整日志:npm ERR!
/home/deck/.npm/_logs/2018-05-16T07_04_57_890Z-debug.log
这是我的angular-cli文件
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"project": {
"name": "angular-electron"
},
"apps": [
{
"root": "src",
"outDir": "dist",
"assets": [
"assets",
"favicon.ico"
],
"index": "index.html",
"main": "main.ts",
"polyfills": "polyfills.ts",
"test": "test.ts",
"tsconfig": "tsconfig.app.json",
"testTsconfig": "tsconfig.spec.json",
"styles": [
"../node_modules/MicroFinanceAssets/css/style.css"
],
"scripts": [],
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}
}
],
"e2e": {
"protractor": {
"config": "./protractor.conf.js"
}
},
"lint": [
{
"project": "src/tsconfig.app.json",
"exclude": "**/node_modules/**"
},
{
"project": "src/tsconfig.spec.json",
"exclude": "**/node_modules/**"
},
{
"project": "e2e/tsconfig.e2e.json",
"exclude": "**/node_modules/**"
}
],
"test": {
"karma": {
"config": "./karma.conf.js"
}
},
"defaults": {
"styleExt": "css",
"component": {}
}
}
如果您需要任何额外的代码详细信息,请评论我,我将提供给您并提前感谢您的时间和考虑
答案 0 :(得分:1)
npm start
您需要从(下)目录MicroFinanceAssets
npm i font-awesome --save
测试
运行"../node_modules/font-awesome/css/font-awesome.css"
并在angular-cli中添加以下行而不是css文件
{{1}}
如果它被编译,那么你的css文件路径是错误的
答案 1 :(得分:0)
这个cli可能对你有所帮助.. 首先在程序中使用安装bootstrap npm install bootstrap --save
并使用此代码更改您的cli
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"project": {
"name": "angular-electron"
},
"apps": [
{
"root": "src",
"outDir": "dist",
"assets": [
"assets",
"favicon.ico"
],
"index": "index.html",
"main": "main.ts",
"polyfills": "polyfills.ts",
"test": "test.ts",
"tsconfig": "tsconfig.app.json",
"testTsconfig": "tsconfig.spec.json",
"styles": [
"../node_modules/admin-ample/template/bootstrap/dist/css/bootstrap.css"
],
"scripts": [
"../node_modules/admin-ample/plugins/bower_components/jquery/dist/jquery.min.js",
],
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}
}
],
"e2e": {
"protractor": {
"config": "./protractor.conf.js"
这对你有帮助吗?
答案 2 :(得分:0)
实际上angular 4
具有可以预先验证的内置功能。在{1.6}旧版本中,如AJ 1.6,它内部没有预先检查。所以你必须确保你的Angular
有任何语法错误和任何额外的字符 - 然后删除它,然后构建它。希望完全可以工作