Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Typescript utils won't install with the new version ( 0.2.1 ) #79

Closed
glued opened this issue Feb 18, 2023 · 11 comments
Closed

Typescript utils won't install with the new version ( 0.2.1 ) #79

glued opened this issue Feb 18, 2023 · 11 comments
Assignees
Labels
bug Something isn't working library: typescript

Comments

@glued
Copy link

glued commented Feb 18, 2023

The new version that was just published throws a bunch of errors when trying to install with npm i

npm ERR! command failed
npm ERR! command sh -c npm run build
npm ERR! > @material/material-color-utilities@0.2.1 build
npm ERR! > npm run remove-build && tsc
npm ERR! 
npm ERR! 
npm ERR! > @material/material-color-utilities@0.2.1 remove-build
npm ERR! > rm -rf dist
npm ERR! 
npm ERR! blend/blend_test.ts(24,1): error TS2304: Cannot find name 'beforeEach'.
npm ERR! blend/blend_test.ts(25,3): error TS2708: Cannot use namespace 'jasmine' as a value.
npm ERR! blend/blend_test.ts(33,1): error TS2582: Cannot find name 'describe'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.
npm ERR! blend/blend_test.ts(34,3): error TS2582: Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.
npm ERR! blend/blend_test.ts(36,5): error TS2304: Cannot find name 'expect'.
npm ERR! blend/blend_test.ts(39,3): error TS2582: Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.
npm ERR! blend/blend_test.ts(41,5): error TS2304: Cannot find name 'expect'.
...
@glued glued changed the title typescript utils won't install with the new version ( 0.2.1 ) Typescript utils won't install with the new version ( 0.2.1 ) Feb 18, 2023
@glued
Copy link
Author

glued commented Feb 18, 2023

tsconfig is including tests in the build

@guidezpl guidezpl added bug Something isn't working library: typescript labels Feb 20, 2023
@guidezpl
Copy link
Collaborator

@rodydavis could you please take a look?

@grzegorzCieslik95
Copy link

The same problem -
image
image

@NDoolan360
Copy link

NDoolan360 commented Feb 24, 2023

Ran into the same error,
Looks it was to do with the postinstall scripts for me.

154 info run @material/material-color-utilities@0.2.1 postinstall node_modules/@material/material-color-utilities npm run build
155 info run @material/material-color-utilities@0.2.1 postinstall { code: 1, signal: null }
...
163 verbose node v18.12.0
164 verbose npm  v8.19.2
165 error code 1
166 error path C:\Users\me\project\node_modules\@material\material-color-utilities
167 error command failed
168 error command C:\WINDOWS\system32\cmd.exe /d /s /c npm run build
169 error > @material/material-color-utilities@0.2.1 build
169 error > npm run remove-build && tsc
169 error
169 error
169 error > @material/material-color-utilities@0.2.1 remove-build
169 error > rm -rf dist
170 error 'rm' is not recognized as an internal or external command,
170 error operable program or batch file.
171 verbose exit 1

You can run the install without these using:
npm i @material/material-color-utilities --ignore-scripts

Not sure what the implications of not running these scripts is tho. 🤷‍♂️

@rodydavis
Copy link
Member

Is is meant to run on bash on Linux or macOS.

related issue: akosbalasko/yarle#220

@Mordech
Copy link

Mordech commented Feb 26, 2023

I think tsconfig.json should exclude **/*_test.ts to not rely on ts files with dev dependencies.
And the postinstall script makes prepublishOnly redundant.

@WillsterJohnson
Copy link

It took approximately 3 seconds of looking at the package.json to know exactly how to resolve the installation fail.

That means none of Google's team have looked at this for longer than a fraction of a second. Either that or Google's devs were unable to resolve this blindingly simple config issue.

@rodydavis
Copy link
Member

Fixing the change internally and will push out, also working on fixing some other related issues.

@rodydavis
Copy link
Member

Will land in 0.2.3

@jiblett1000
Copy link

@rodydavis Seems to be working in 2.2 so far (at least build-wise). Tinkering with it at the moment.

@glued glued closed this as completed Mar 4, 2023
@guidezpl
Copy link
Collaborator

guidezpl commented Mar 6, 2023

@WillsterJohnson That is not an acceptable way to speak to any developer, please refer to https://developer.mozilla.org/en-US/docs/MDN/Community/Open_source_etiquette and consider making more constructive comments in the future.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working library: typescript
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants