We are working on a new angular ionic app and it builds on all our machines from powershell but on our build machine when it pulls the files from perforce to our D: drive it fails to build. Our build machine is using teamcity and we are using the powershell build step to run our ng commands. I can take the exact same files and they will build if I point the powershell script to them explicitly (I even deleted node_modules before doing this).
Here is the error we get. I removed the parts of the path’s related to our build machine to keep it cleaner.
ERROR in ./src/global.scss (<path to application>/node_modules/css-loader/dist/cjs.js??ref--13-1!<path to application>/node_modules/postcss-loader/src??embedded!/node_modules/sass-loader/dist/cjs.js??ref--13-3!./src/global.scss)
Module build failed (from <path to application>/node_modules/postcss-loader/src/index.js):
Error: Failed to find '@ionic/angular/css/core.css'
in [
<path to application>\projects\ta\src
]
at resolveModule.catch.catch (<path to application>\node_modules\postcss-import\lib\resolve-id.js:35:13)
@ ./src/global.scss 2:26-225
@ multi ./src/theme/variables.scss ./src/global.scss ./src/theme/site.scss
I checked if the @ionic/angular/css/core.css
file was really missing and it was in the node_modules even when it fails to find it.
We use the following command to build
ng run ta:build --verbose
We are using the following versions of various pieces of software
- Npm: 6.9.0
- Angular CLI: 1.6.7
- Node: 10.16.0
I am not very familiar with building angular apps so if there is other information you need from me give me the heads up and I can provide it.
{
"name": "tenantapp",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "https://ionicframework.com/",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"start:ta": "node --max-old-space-size=8192 \"node_modules\\@angular\\cli\\bin\\ng\" serve ta --open",
"build:ionic": "ionic build"
},
"private": true,
"dependencies": {
"@angular/animations": "^10.0.9",
"@angular/cdk": "^10.1.3",
"@angular/common": "~9.1.6",
"@angular/core": "~9.1.6",
"@angular/forms": "~9.1.6",
"@angular/material": "^10.1.3",
"@angular/platform-browser": "~9.1.6",
"@angular/platform-browser-dynamic": "~9.1.6",
"@angular/router": "~9.1.6",
"@angular/service-worker": "~9.1.6",
"@capacitor/android": "^2.3.0",
"@capacitor/core": "2.3.0",
"@capacitor/ios": "^2.3.0",
"@ionic-native/core": "^5.0.7",
"@ionic-native/splash-screen": "^5.0.0",
"@ionic-native/status-bar": "^5.0.0",
"@ionic/angular": "^5.0.0",
"@ionic/cli": "^6.12.1",
"@ionic/pwa-elements": "^3.0.1",
"fibers": "^3.1.0",
"ng-recaptcha": "^6.0.2",
"node-sass": "^4.14.1",
"primeng": "^10.0.0-rc.3",
"rxjs": "^6.5.5",
"tslib": "^1.10.0",
"zone.js": "~0.10.2"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.901.5",
"@angular/cli": "~9.1.5",
"@angular/compiler": "~9.1.6",
"@angular/compiler-cli": "~9.1.6",
"@angular/language-service": "~9.1.6",
"@capacitor/cli": "2.3.0",
"@ionic/angular-toolkit": "^2.1.1",
"@types/jasmine": "~3.5.0",
"@types/jasminewd2": "~2.0.3",
"@types/node": "^12.11.1",
"codelyzer": "^5.1.2",
"jasmine-core": "~3.5.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~5.0.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~2.1.0",
"karma-jasmine": "~3.0.1",
"karma-jasmine-html-reporter": "^1.4.2",
"protractor": "~5.4.3",
"ts-node": "~8.3.0",
"tslint": "~6.1.0",
"typescript": "~3.8.3"
},
"description": "An Ionic project"
}
EDIT: I did not mention this in the initial question but the D: drive is a ram disk. Ultimately this ended up being very important information and I updated the question to include this and the ramdisk tag so hopefully others will find this solution quicker than I did in the future.
node_modules
folder and runnpm install
Then, if you're using Ionic, build using this command :ionic build
If you still have problems, please add your package.json on the topicpackage.json
when I get the source from p4 we have nonode_mobules
and it wont even when I runnpm install
. If I then take the same files that are pulled from p4 and build from the command line instead of teamcity it builds just fine. The commands are exactly the same that run from teamcity and powershell and I have done this with the same user as well.Invalidate Cache/Restart