angular / components

Component infrastructure and Material Design components for Angular
https://material.angular.io
MIT License
24.23k stars 6.7k forks source link

Cannot build on Windows #6211

Closed Pikachews closed 6 years ago

Pikachews commented 6 years ago

Bug, feature request, or proposal:

Bug

What is the expected behavior?

Should be able to build on Windows

What is the current behavior?

Can't build package on windows

I get a bunch of this error repeatedly:

[19:07:56] TypeError in plugin 'run-sequence(cdk:build-release)'
Message:
    Cannot read property 'toString' of null
Stack:
TypeError: Cannot read property 'toString' of null
    at Object.replaceVersionPlaceholders (C:\angular\material2\tools\package-tools\version-placeholders.ts:18:9)
    at Object.composeRelease (C:\angular\material2\tools\package-tools\build-release.ts:37:3)
    at Gulp.<anonymous> (C:\angular\material2\tools\package-tools\gulp\build-tasks-gulp.ts:68:66)
    at module.exports (C:\angular\material2\node_modules\orchestrator\lib\runTask.js:34:7)
    at Gulp.Orchestrator._runTask (C:\angular\material2\node_modules\orchestrator\index.js:273:3)
    at Gulp.Orchestrator._runStep (C:\angular\material2\node_modules\orchestrator\index.js:214:10)
    at Gulp.Orchestrator.start (C:\angular\material2\node_modules\orchestrator\index.js:134:8)
    at runNextSet (C:\angular\material2\node_modules\run-sequence\index.js:86:16)
    at Gulp.onTaskEnd (C:\angular\material2\node_modules\run-sequence\index.js:75:5)
    at emitOne (events.js:120:20)
[19:07:56] 'material:build' errored after 19 s

I would assume it has something to do with windows not having grep, considering line 18 of version-placeholders.ts

18    const files = spawnSync('grep', ['-ril', versionPlaceholderText, packageDir]).stdout
19        .toString()
20        .split('\n')
21        .filter(String);

What is the use-case or motivation for changing an existing behavior?

Wish to be able to build on windows

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

angular/material2@master

tarunguddeti commented 6 years ago

I have got the same issue. Could someone please help me resolve the problem. I think there is some issue with the spwan method.

tarunguddeti commented 6 years ago

Specifiying the shell as explicitly as node ( { shell: "node" } ) and passing it as the thrid parameter to spwanSync Resolved the issue. Now I can build it on Windows without any issues !

const files = spawnSync('grep', ['-ril', versionPlaceholderText, packageDir], { shell: "node" }).stdout

Pikachews commented 6 years ago

The errors seem to originate from a different place now:

[14:35:39] TypeError: Cannot read property 'toString' of null
    at D:\Stuff\Projects\angular\material2\tools\package-tools\secondary-entry-points.ts:42:13
    at Array.forEach (native)
    at Object.getSecondaryEntryPointsForPackage (D:\Stuff\Projects\angular\material2\tools\package-tools\secondary-entry-points.ts:38:14)
    at BuildPackage.get [as secondaryEntryPoints] (D:\Stuff\Projects\angular\material2\tools\package-tools\build-package.ts:36:36)
    at BuildPackage.<anonymous> (D:\Stuff\Projects\angular\material2\tools\package-tools\build-package.ts:59:34)
    at step (D:\Stuff\Projects\angular\material2\tools\package-tools\build-package.ts:32:23)
    at Object.next (D:\Stuff\Projects\angular\material2\tools\package-tools\build-package.ts:13:53)
    at fulfilled (D:\Stuff\Projects\angular\material2\tools\package-tools\build-package.ts:4:58)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:169:7)
devversion commented 6 years ago

@Pikachews For developers on Windows that have the Git Bash installed, the issue should be fixed with https://github.com/angular/material2/commit/509e3e90f5ad985099342d587f6c703ef4406cea

For people without Git Bash, I'm planning on creating a new query that works for Windows as well (sometime soon)

georgeneil commented 6 years ago

It works when do an 'npm run *' from The Git Bash

angular-automatic-lock-bot[bot] commented 4 years ago

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.