-
-
Notifications
You must be signed in to change notification settings - Fork 359
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
[Node.js 12.11+ and Windows 10] Error: Cannot find module "node" #1205
Comments
Can you give nyc 15.0.0-beta.0 a try? The issue you are seeing here is the result of spawn-wrap having trouble under Windows. The next version of nyc will by-pass spawn-wrap in favor of a different method. Please note that |
Indeed, using |
I've also run into this, what is the 15.0 release waiting on? Is there something I can do to help get it released sooner? |
nyc 15 is a complex release with major changes. The tracking ticket is #1104 so you can subscribe to that for progress updates. Getting close to the final stretch I just need to get some more testing with major ecosystem projects (testing frameworks). Beyond that it's really a matter of me having time to do the release and support issues that will occur upon release (not everyone reads the CHANGELOG.md and some assume that breaking changes are bugs). If nyc 15.0.0-beta.0 fixes bugs for you then my advice is to use it. You may want to pin to |
Gets around istanbuljs/nyc#1205 breaking on Windows with Node 12.
Gets around istanbuljs/nyc#1205 breaking on Windows with Node 12.
I need to get this working on macosx/windows/linux. Upgrading to 15.0.0-beta.0 as suggested on macosx results in:
Digging in, it seems this is a problem on 15.0.0-beta.0 with needing |
I was able to verify on macosx that adding the |
please use 15.0.0-beta.3, there was a late breaking change to test-exclude. |
the version of nyc that was being used had defect (istanbuljs/nyc#1205) that was preventing ci from passing
nyc@<15 is broken on Windows (see istanbuljs/nyc#1205)
Is there any workaround to upgrading to nyc 15 to fix this? Is it caused by a spawn-wrap update that can be avoided by pinning it? |
In eslint-plugin-import you are using [email protected] which actually has [email protected] bundled (1.4.2 was released on Dec 5 2017). What happens if you force your CI to test 12.10.0 on Windows, does this currently pass? I ask since this report seems to indicate the problem started with the upgrade to node.js 12.11.0, not with any nyc update. Not suggesting this is a solution, just seeking confirmation of the source of the problem. As far as spawn-wrap I'm not sure 2.x even fixes the issue, by default nyc 15 does not use spawn-wrap as it is unreliable (especially on Windows). nyc 15 instead uses |
I'll try 12.10, thanks, that's a good suggestion. |
nyc@<15 is broken on Windows (see istanbuljs/nyc#1205)
Doesn't look like appveyor offers a way to do that :-/ |
nyc@<15 is broken on Windows (see istanbuljs/nyc#1205)
nyc@<15 is broken on Windows (see istanbuljs/nyc#1205)
I experienced the aforementioned issues and wanted to mention that 15.0.0 works for me. |
There are a bunch of outdated packages here, but looks like there's an issue with this version of `nyc` specifically, istanbuljs/nyc#1205. Updating just that for now, but should really get things updated in general here, as well as move to GH Actions. (Also removed `cross-env` since it's doing nothing of value here.)
FWIW, I found that spawn-wrap 1.4.3 fixed the issues I was seeing (which was happening even on older versions of Node). |
My use case: I have TypeScript projects that are coded as ES modules (for example: cedx/coveralls.js or cedx/which.js). They are intended to run on Node.js v12.x only and use the field
"type": "module"
in thepackage.json
file (i.e. the used file extension is.js
, not.mjs
).For the tests and code coverage, I'm using
ts-node
to avoid compiling the projects while I develop them. So, in test environment, the projects are compiled on the fly as CommonJS modules (ts-node
does not support ES modules).The command line used:
nyc --nycrc-path=etc/nyc.json node_modules/.bin/mocha --config=etc/mocha.json "test/**/*.ts"
This configuration worked fine on Node v12.10.x and below, but since v12.11.0 the tests don't run anymore on Windows and produce this error:
If I run the tests without code coverage, no error occurs:
mocha --config=etc/mocha.json "test/**/*.ts"
=> everything is OK.Link to bug demonstration repository
https://github.com/cedx/enum.js
Expected Behavior
The tests succeed to run and the code coverage is collected.
Observed Behavior
The tests fail to run if code coverage is collected with
nyc
.Troubleshooting steps
cache: false
in my nyc configEnvironment Information
The text was updated successfully, but these errors were encountered: