Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Windows Build and Test Fail #30

Closed
ankitaggarwal011 opened this issue Jun 30, 2015 · 6 comments
Closed

Windows Build and Test Fail #30

ankitaggarwal011 opened this issue Jun 30, 2015 · 6 comments

Comments

@ankitaggarwal011
Copy link

The building instructions for tota11y doesn't specify any OS. I tried building the package on Windows 7 (x64) with latest tota11y source. I am using command prompt for running the commands.

npm -v
2.5.1

I used these commands:

npm install
npm run build

The first command worked fine and installed the dependencies. However, the second command produced the following error (I am pasting the npm-debug.log here):

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'build' ]
2 info using npm@2.5.1
3 info using node@v0.12.0
4 verbose node symlink C:\Program Files\nodejs\\node.exe
5 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
6 info prebuild tota11y@0.0.3
7 info build tota11y@0.0.3
8 verbose unsafe-perm in lifecycle true
9 info tota11y@0.0.3 Failed to exec build script
10 verbose stack Error: tota11y@0.0.3 build: `webpack -p`
10 verbose stack Exit status 1
10 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:213:16)
10 verbose stack     at EventEmitter.emit (events.js:110:17)
10 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:14:12)
10 verbose stack     at ChildProcess.emit (events.js:110:17)
10 verbose stack     at maybeClose (child_process.js:1008:16)
10 verbose stack     at Process.ChildProcess._handle.onexit (child_process.js:1080:5)
11 verbose pkgid tota11y@0.0.3
12 verbose cwd D:\Documents\General\Github\tota11y
13 error Windows_NT 6.1.7601
14 error argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
15 error node v0.12.0
16 error npm  v2.5.1
17 error code ELIFECYCLE
18 error tota11y@0.0.3 build: `webpack -p`
18 error Exit status 1
19 error Failed at the tota11y@0.0.3 build script 'webpack -p'.
19 error This is most likely a problem with the tota11y package,
19 error not with npm itself.
19 error Tell the author that this fails on your system:
19 error     webpack -p
19 error You can get their info via:
19 error     npm owner ls tota11y
19 error There is likely additional logging output above.
20 verbose exit [ 1, true ]

On searching for build instructions for Node.js on Windows, I found out that this issue is related to the relative paths and could be simply resolved by running this command for building (Don't use the run keyword on Windows):

npm build

This should be updated in documentation for build instructions.

Other than this, testing also fails on Windows:

npm test

gives out errors:

> open http://localhost:8080/webpack-dev-server/ && webpack-dev-server --hot

'open' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! Test failed.  See above for more details.

Update:

Changing
"test": "open http://localhost:8080/webpack-dev-server/ && webpack-dev-server --hot"
to
"test": "start http://localhost:8080/webpack-dev-server/ && webpack-dev-server --hot"
in package.json file solved the testing error on Windows.

I suggest not to force open a the debug URL while testing, this would ensure compatibility across different platforms.

"test": "webpack-dev-server --hot"

And then the debug environment can be accessed on http://localhost:8080/webpack-dev-server/.
@jdan

ankitaggarwal011 added a commit to ankitaggarwal011/tota11y that referenced this issue Jun 30, 2015
@ankitaggarwal011 ankitaggarwal011 changed the title Windows Build Fail Windows Build and Test Fail Jun 30, 2015
@jdan
Copy link
Owner

jdan commented Jun 30, 2015

I'm phasing out the open line very soon - we have some unit tests up for review on our internal code review tool, so npm test will be running mocha tests instead of opening the browser.

The part about leaving out run is quite interesting, thank you for looking into this! I would probably prefer to the documentation to say something along the lines of:

npm install
npm run build   # or "npm build" on Windows

What do you think? I'll include that README change with my unit tests so they'll ship simultaneously.

@ankitaggarwal011
Copy link
Author

Yes, mocha tests would definitely be an upgrade. Yes, a simple comment with build also works. Add this to your README change list. I think there would definitely me more before you ship out next version.
Cheers! @jdan

I am looking into #13 as well. Is that included in your next release as well. I included an congratulatory message for that issue in my local repository. Do you want me to push to master?

@jdan
Copy link
Owner

jdan commented Jun 30, 2015

@ankitaggarwal011 Yes features can branch right off master for now - no specific release cycle here. Thank you for your enthusiasm!

@jdan
Copy link
Owner

jdan commented Jun 30, 2015

@ankitaggarwal011 Okay the README is updated, and unit tests have landed in master. Let me know what you think.

@jdan jdan closed this as completed Jun 30, 2015
@ankitaggarwal011
Copy link
Author

@jdan , I synced the new changes in my local repository and tested for the updated commands on Windows 7(x64).
Some interesting things happened (you will need to make some changes again). All these commands are working now:

npm install 
npm run build
npm test
npm run lint
npm run live-test

Building the package gives warnings, but that's a different issue.

I am sorry for raising false alarms, but I reported what happened earlier. Now, those errors are gone. I am not sure why these things happened. Could be Windows specific behavior (I didn't even restart the system since reporting the issue). Puzzled. But, you can remove those windows specific lines from README as they are no longer a problem.

@jdan
Copy link
Owner

jdan commented Jun 30, 2015

@ankitaggarwal011 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants