Skip to content

Commit

Permalink
package.json: Add npm prepare script
Browse files Browse the repository at this point in the history
We need this because we are installing directly from git instead of
via npmjs.com so we need to make sure that npm builds the libraries
after installing.

The caveat is that we need to use --legacy-peer-deps when building
md-menu because of some bug in npm that causes it to prefer higher
versions when range is given (we have @angular/forms@^9.0.0...):

> npm ERR! Could not resolve dependency:
> npm ERR! peer @angular/common@"10.2.5" from @angular/forms@10.2.5
> npm ERR! node_modules/@angular/forms
> npm ERR!   peer @angular/forms@"^9.0.0 || ^10.0.0-0" from @angular/material@9.2.4
> npm ERR!   node_modules/@angular/material
> npm ERR!     peer @angular/material@">=7.0.0 <10.0.0" from the root project

Also, it seems the npm postinstall was not necessary.

See: npm/cli#3152
  • Loading branch information
alanorth committed Aug 22, 2021
1 parent 4271a65 commit a95c60e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"pub:lib:ngx-bootstrap": "cd dist/ngx-tour-ngx-bootstrap && npm publish",
"pub:lib:ngx-popper": "cd dist/ngx-tour-ngx-popper && npm publish",
"pub:lib:md-menu": "cd dist/ngx-tour-md-menu && npm publish",
"postinstall": "ngcc"
"prepare": "npm run build:lib:core && npm run build:lib:md-menu --legacy-peer-deps"
},
"dependencies": {
"@angular/animations": "^9.1.13",
Expand Down

0 comments on commit a95c60e

Please sign in to comment.