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

npm install v8flags Still Fails on Windows #9

Closed
Techdoode opened this issue Nov 29, 2014 · 17 comments
Closed

npm install v8flags Still Fails on Windows #9

Techdoode opened this issue Nov 29, 2014 · 17 comments

Comments

@Techdoode
Copy link

I have NodeJS version v0.10.33 installed on a Dell PC running Windows 7 Ultimate. The npm version is 1.4.28.
When I issue npm install v8flags, I receive the following output from npm:

\

[email protected] install c:\xampp\htdocs\responsive\node_modules\v8flags
node fetch.js

npm ERR! [email protected] install: node fetch.js
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the v8flags package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node fetch.js
npm ERR! You can get their info via:
npm ERR! npm owner ls v8flags
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "c:\Program Files\nodejs\node.exe" "c:\Program Files\nodejs\node_modules
\npm\bin\npm-cli.js" "install" "v8flags"
npm ERR! cwd c:\xampp\htdocs\responsive
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! syscall spawn
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! not ok code 0

I first encountered the problem attempting to install Gulp. The install failed with messages similar to the above. I then attempted to npm install v8flages, with the above results.

@yocontra
Copy link
Member

duplicate of #6 (no global node install, different codepaths though)

@yocontra
Copy link
Member

@tkellen Problem is https://github.com/tkellen/node-v8flags/blob/master/package.json#L24

I think you can just put a .js file in there and npm will run it, I don't think you need to specify node

@Techdoode
Copy link
Author

I hate to admit this, but the problem appears to be "operator error."

I was trying to execute 'npm install' in Git Bash. Troubleshooting, I discovered even attempting to run 'node fetch.js' failed.

Using the Windows command prompt instead, everything works fine.

@tkellen
Copy link

tkellen commented Nov 30, 2014

That is hugely helpful to know. I will run some tests to see if I can make
it work for both. shakes fist at windows

Also yes, the caching is intentional.
On Nov 30, 2014 11:03 AM, "Nick" [email protected] wrote:

I hate to admit this, but the problem appears to be "operator error."
I was trying to npm install using Git Bash.

When I use the Windows command prompt instead, everything worked fine.
The odd thing is that I'm pretty sure I used Git Bash successfully in the
past.


Reply to this email directly or view it on GitHub
#9 (comment).

@matma
Copy link

matma commented Dec 1, 2014

I've been trying to debug it. IMHO problem lays in spawning child process.
Looks like child process (C:\Program Files\node.exe --v8-options) is looking for some file/directory during initialization, but could't find it. Error message says only that there was an ENOENT error (without any additional information about path that child process is looking for with is 😞 ).
I've cloned the repo, and simple "node fetch.js" throws that error.
Npm version: 1.4.28, Node: 0.10.33, Windows 8.1

Maybe better solution will be catching the flags before install (as simple as "node --v8-flags > flags.temp && node fetch.js" of something similar) and run all the parsing logic on that file. It's very simple change, but you'll avoid all that child_process crazy magic 🔮

@Techdoode
Copy link
Author

@tkellen LOL! Yeah, I feel that way sometimes... often. Sometimes I stop and say, "Wait! Why am I spending so much time on this?"

@matma The paths in both Windows cmd and Git Bash to be the same on my machine. However, when I executed 'node fetch.js' node seemed not to understand standard keywords. For example, the 'new' keyword. If I modified 'fetch.js' to eliminate this problem, 'node' complained that I hadn't defined 'require'.

It was as if 'node' couldn't parse the JavaScript correctly. Note: in the original output the caret appears beneath the "n" in "new":

Desktop(master) > node fetch.js

c:\Users\Nick\Desktop\fetch.js:11
throw new Error(execErr);
^
Error: Error: spawn ENOENT
at c:\Users\Nick\Desktop\fetch.js:11:7
at exithandler (child_process.js:644:7)
at ChildProcess.errorhandler (child_process.js:660:5)
at ChildProcess.emit (events.js:95:17)
at Process.ChildProcess._handle.onexit (child_process.js:808:12)
Desktop(master) >

@matma
Copy link

matma commented Dec 2, 2014

@Techdoode I think that is normal behaviour - child_process.exec throws an error, and node is rethrowing it - there's no handler that can catch it, so it fails with that message. Caret shows the beginning of the line that throws.

What is even stranger - I've got Windows 8 on virtual box, and on that machine everything works fine. However node wasn't almost use on it. So it's a "fresh" 0.10.33 installation.

I'll investigate it further...

@matma
Copy link

matma commented Dec 2, 2014

@tkellen please take a look at matma/node-v8flags@afbce3f tested on Windows and OSX, works fine. Little less magic, if you want I can do PR at any time...

@Techdoode
Copy link
Author

@matma Works on my machine. :-)
Would it be desirable to delete 'flags.temp' after 'fetch.js' completes?
Also, I wonder what happens when someone executes v8flags.fetch(), as they do in 'gulp.js'?

https://github.com/gulpjs/gulp/blob/master/bin/gulp.js#L25

As you can tell from my earlier comments, I'm new at this. So this may be a non-issue.

@matma
Copy link

matma commented Dec 2, 2014

@Techdoode - yeah I will look at this, unlinkSync looks like cross-platform rm :)
v8flags.fetch() - these API doesn't change, it reads the cache file that is stored in module directory, so IMHO this isn't issue. The only thing that change is how you get that cache file created 😇

@tkellen
Copy link

tkellen commented Dec 2, 2014

@contra was #4 actually something you saw in the wild? I'm thinking of reverting if not. @matma, that looks nice! It's more or less what I had in 1.0.0 https://github.com/tkellen/node-v8flags/blob/1.0.0/fetch.js#L9

@Techdoode
Copy link
Author

@matma unlinkSync looks okay to me, if it works on Windows. However, I think we agree I basically know nothing, right? :-)

@yocontra
Copy link
Member

yocontra commented Dec 3, 2014

@tkellen Why revert it?

@tkellen
Copy link

tkellen commented Dec 3, 2014

Because it is causing all kinds of issues for people on Windows, and because the fix being suggested by them amounts to reverting the change. Before making that decision, I want to know if your suggestion in #4 had manifest itself in reality.

@yocontra
Copy link
Member

yocontra commented Dec 3, 2014

@tkellen No it was a bug I spotted when looking through the code. Since I don't use multiple node installs I have not experienced it personally, but anyone who does would definitely be bit by that.

@yocontra
Copy link
Member

yocontra commented Dec 3, 2014

@tkellen Can you point me to where it was identified that the problem was there (and why)?

@tkellen
Copy link

tkellen commented Jan 15, 2015

Should be fixed in v8flags 2.0.0. Depends on gulpjs/gulp-cli#11

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

No branches or pull requests

4 participants