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

Error: Cannot find module './reports/base' #624

Closed
mateusvahl opened this issue Dec 2, 2019 · 5 comments
Closed

Error: Cannot find module './reports/base' #624

mateusvahl opened this issue Dec 2, 2019 · 5 comments

Comments

@mateusvahl
Copy link

I just installed tap and received the follow errors:

Screen Shot 2019-12-02 at 13 04 56

How to reproduce:

  1. Install tap and esm: yarn add tap esm
{
  "tap": "14.10.2",
  "esm": "^3.2.25"
}
  1. Tap a file: tap my-test-file.js
const tap = require('tap')
tap.pass('this is fine')

Info

  • macOS with docker
  • node version: 10.16.3

How did I solved:

It seems that adding a reporter solves the problem: tap my-test-file.js --reporter classic

Let me know if you need more information,
Best

@coreyfarrell
Copy link
Member

I've experienced this issue as well with npm. I determined that having babel.config.js which enables the plugin @babel/plugin-transform-modules-commonjs caused the issue. This would include @babel/preset-env. CC @jaydenseric

Adding ignore: ['**/node_modules/**'] to my babel.config.js worked around this issue. I've posted a PR to import-jsx to fix this issue.

@coreyfarrell
Copy link
Member

Not sure what happened, the ignore: ['**/node_modules/**'] was working earlier (I think) but now it's not for me. I've rewritten my babel.config.js to restrict all options within the overrides option:

'use strict';

module.exports = {
	overrides: [{
		test: ['src/**'],
		plugins: [
			'@babel/plugin-transform-modules-commonjs'
		]
	}]
};

asheshv added a commit to asheshv/infinite-tree that referenced this issue Dec 10, 2019
@coreyfarrell
Copy link
Member

This issue should be resolved by tap@14.10.6, can anyone confirm?

@coreyfarrell
Copy link
Member

If anyone still experiences the issue with tap 14.10.6+ let us know and this issue can be reopened.

@BethGriggs
Copy link

I'm seeing something similar to this with certain modules and Node.js 16. For example, this is from running npm's test suite:

 added 522 packages, and changed 14 packages in 41s
 > npm@7.8.0 test
 > tap
 TAP version 13
 1..0
 # time=3.497ms
 ----------|----------|----------|----------|----------|-------------------|
 File      |  % Stmts | % Branch |  % Funcs |  % Lines | Uncovered Line #s |
 ----------|----------|----------|----------|----------|-------------------|
 All files |        0 |        0 |        0 |        0 |[31;1m                  [0m |
 ----------|----------|----------|----------|----------|-------------------|
 Error: Cannot find module './reports/base'
 Require stack:
 - /home/iojs/tmp/citgm_tmp/81754b80-27f7-459c-8dc8-8e0b3ae2f845/npm/node_modules/jackspeak/noop.js
     at Function.Module._resolveFilename (node:internal/modules/cjs/loader:940:15)
     at resolveFileName (/home/iojs/tmp/citgm_tmp/81754b80-27f7-459c-8dc8-8e0b3ae2f845/npm/node_modules/tap/node_modules/resolve-from/index.js:17:39)
     at resolveFrom (/home/iojs/tmp/citgm_tmp/81754b80-27f7-459c-8dc8-8e0b3ae2f845/npm/node_modules/tap/node_modules/resolve-from/index.js:31:9)
     at module.exports (/home/iojs/tmp/citgm_tmp/81754b80-27f7-459c-8dc8-8e0b3ae2f845/npm/node_modules/tap/node_modules/resolve-from/index.js:34:41)
     at importJSX (/home/iojs/tmp/citgm_tmp/81754b80-27f7-459c-8dc8-8e0b3ae2f845/npm/node_modules/tap/node_modules/import-jsx/index.js:24:21)
     at module.exports (/home/iojs/tmp/citgm_tmp/81754b80-27f7-459c-8dc8-8e0b3ae2f845/npm/node_modules/tap/node_modules/treport/lib/index.js:13:18)
     at exports.makeReporter (/home/iojs/tmp/citgm_tmp/81754b80-27f7-459c-8dc8-8e0b3ae2f845/npm/node_modules/tap/bin/run.js:422:23)
     at runTests (/home/iojs/tmp/citgm_tmp/81754b80-27f7-459c-8dc8-8e0b3ae2f845/npm/node_modules/tap/bin/run.js:744:3)
     at mainAsync (/home/iojs/tmp/citgm_tmp/81754b80-27f7-459c-8dc8-8e0b3ae2f845/npm/node_modules/tap/bin/run.js:244:5)
     at main (/home/iojs/tmp/citgm_tmp/81754b80-27f7-459c-8dc8-8e0b3ae2f845/npm/node_modules/tap/bin/run.js:127:3) {
   code: 'MODULE_NOT_FOUND',
   requireStack: [
     '/home/iojs/tmp/citgm_tmp/81754b80-27f7-459c-8dc8-8e0b3ae2f845/npm/node_modules/jackspeak/noop.js'
   ]
 }

Adding a reporter as suggested here resolves the issue.

Refs: nodejs/citgm#852 (comment), nodejs/citgm#852 (comment)

visnup pushed a commit to observablehq/stdlib that referenced this issue Sep 7, 2021
* document xlsx (minimalist, we'll work on the notebook first)

* fix coverage reporter

(avoids a crash on my computer; solution found at tapjs/tapjs#624)

* unknown sheet name

* simplify rows naming

* NN is always called on string (cell specifier such as "AA99")

* test name

* more range specifiers
visnup added a commit to observablehq/stdlib that referenced this issue Sep 15, 2021
* XLSX support with ExcelJS

* Prettier

* Change range option to nested arrays

General code clean up

* Tests and bug fixes

* Respect header row order when resolving conflicts

* Fil/xlsx (#249)

* document xlsx (minimalist, we'll work on the notebook first)

* fix coverage reporter

(avoids a crash on my computer; solution found at tapjs/tapjs#624)

* unknown sheet name

* simplify rows naming

* NN is always called on string (cell specifier such as "AA99")

* test name

* more range specifiers

* Column only range test case

* sheetNames is enumerable

* One more test to check for empty columns

Prettier + use default/base tap reporter

* Add Node 16 to the test matrix

* Revert reporter to classic for Node 16

* Don't fail matrix quickly in actions

* More coverage.

* Example of .xlsx in README

* Remove Excel from Workbook naming

* Fix dates

* Fix for sharedFormula

* Coerce errors to NaN

* Properly escape html

* Make sheetNames read-only

* Require colons in range specifiers

* Include row numbers

* Use only string form ranges

* Coerce range specifiers to strings

* Update README.md

Co-authored-by: Mike Bostock <mbostock@gmail.com>

* Apply suggestions from code review

Co-authored-by: Mike Bostock <mbostock@gmail.com>

* Simplify hyperlinks

* Prettier

* Pass options through

* Rename helper functions for clarity, range tests

* Simpler

* Consistent comment format

* Consistent regexes

* Fix hyperlinks for certain cases

Co-authored-by: Philippe Rivière <fil@rezo.net>
Co-authored-by: Mike Bostock <mbostock@gmail.com>
gfyoung added a commit to forking-repos/node-ignore that referenced this issue Nov 3, 2021
Also adds 16.x (latest LTS) to testing suite.

xref: tapjs/tapjs#624

The issue is closed, but it is still being reported.

xref: nodejs/citgm#852 (comment)

This is the fix being used in this commit.
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

3 participants