Closed hjalmers closed 6 years ago
New build error when building through Travis CI
Hi @mklein994, you wouldn't have any experience building scoped packages through travis would you? I fixed the first build error but got another one for the second package which depends on the core package which is built without errors. Not sure if the config for Travis is wrong but running the build script locally works...
@hjalmers, no unfortunately I don't. That's partially the reason why I wanted continuous integration; if it works in CI, I could get a sense of how to build the project from scratch 😉. Have you tried cloning the repo to a new directory and running npm install
then npm run build:new
from there?
I just tried doing that, and it failed with the same message, even when running it explicitly:
$ npx ng-packagr -p @angular-generic-table/column-settings/ng-package.json
Name | Version |
---|---|
Operating System | Ubuntu 16.04.4 LTS (Windows 10; Windows Subsystem for Linux) |
Node | v9.11.1 (nvm) |
npm | 5.6.0 |
Just a hunch; try comparing the directories between the one that works and a fresh clone after installing and building. Are any of the files different? (package-lock.json, perhaps?)
@mklein994 I know the reason, which I should have thought about, ng-packagr uses a different approach and in order for it to be able to build the scoped package we need to use npm link.
If you run the following command in the project root:
cd @angular-generic-table/core && npm link && cd ../../ && npm link @angular-generic-table/core
It should work. There might be some other way to let ng-packagr know where to look for the core package when building column-settings but npm link makes local development of scoped packages a lot easier too. I've added a script for this which I'll merge back to the master branch once I'm done preparing and updating the examples for angular 5+.
@hjalmers what editor do you use?
@mklein994 webstorm by jetbrains:)
Putting this here for future reference:
TL;DR: run npm install
in WSL for the main project and sub projects, then do the linking (npm link
and npm link @angular-generic-table/*
) in Windows.
These steps allow you to run npx ng serve
from WSL, while working on @angular-generic-table/core
or @angular-generic-table/column-settings
from Visual Studio Code without it warning about missing modules.
Works as of 2018-04-18:
nvm version
: 1.1.6
node --version
: 9.11.1 64-bit
npm --version
: 5.6.0
code --version
: 1.22.2 3aeede733d9a3098f7b4bdc1f66b63b0f48c1ef9 x64
nvm --version
: 0.33.9
node --version
: v9.11.1
npm --version
: 5.6.0
npm install
1.2. cd ./@angular-generic-table/core
1.3. Run npm install
in that directory. (This installs node-sass and other system specific stuff correctly.)./@angular-generic-table/core
and run npm link
2.2. Go back up to project root and run npm link @angular-generic-table/core
@angular-generic-table/column-settings
from project root.
3.2. Repeat from step 1.3., linking @angular-generic-table/column-settings
to the local version.