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

SyntaxError: The requested module 'process' does not provide an export named 'report' #41774

Closed
madflow opened this issue Jan 30, 2022 · 7 comments
Labels
esm Issues and PRs related to the ECMAScript Modules implementation. process Issues and PRs related to the process subsystem.

Comments

@madflow
Copy link
Contributor

madflow commented Jan 30, 2022

Affected URL(s)

https://nodejs.org/api/process.html#processreport

Description of the problem

import { report } from 'process';

console.log(`Reports are compact? ${report.compact}`);

yields:

import { report } from 'process';
         ^^^^^^
SyntaxError: The requested module 'process' does not provide an export named 'report'

The process module seems not to be fully esm ready?

node --version
v17.4.0

@madflow madflow added the doc Issues and PRs related to the documentations. label Jan 30, 2022
@Mesteery Mesteery added esm Issues and PRs related to the ECMAScript Modules implementation. process Issues and PRs related to the process subsystem. labels Jan 30, 2022
@dollar22
Copy link

Hey I wanna work on this could someone tell me what should i have to do @Mesteery

@Mesteery
Copy link
Contributor

enumerable: false,

@dollar22 You should set enumerable to true instead of false here.

@Mesteery Mesteery removed the doc Issues and PRs related to the documentations. label Jan 30, 2022
@dollar22
Copy link

dollar22 commented Jan 31, 2022

@Mesteery I changed it to true but when I run ./configure && make -j4 test to test lots of error comes

Path: parallel/test-policy-integrity-flag
node:assert:170
  throw err;
  ^

AssertionError [ERR_ASSERTION]: This test shouldn't load properties from a package.json above its file location. Found package.json at /home/lenovo/package.json.
    at Proxy.requireNoPackageJSONAbove (/home/lenovo/Desktop/node/node/test/common/index.js:747:14)
    at Object.<anonymous> (/home/lenovo/Desktop/node/node/test/parallel/test-policy-integrity-flag.js:6:8)
    at Module._compile (node:internal/modules/cjs/loader:1097:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47 {
  generatedMessage: false,
  code: 'ERR_ASSERTION',
  actual: undefined,
  expected: undefined,
  operator: 'fail'
}

Node.js v18.0.0-pre
Command: out/Release/node /home/lenovo/Desktop/node/node/test/parallel/test-policy-integrity-flag.js
=== release test-policy-parse-integrity ===                    
Path: parallel/test-policy-parse-integrity
node:assert:170
  throw err;
  ^

AssertionError [ERR_ASSERTION]: This test shouldn't load properties from a package.json above its file location. Found package.json at /home/lenovo/package.json.
    at Proxy.requireNoPackageJSONAbove (/home/lenovo/Desktop/node/node/test/common/index.js:747:14)
    at Object.<anonymous> (/home/lenovo/Desktop/node/node/test/parallel/test-policy-parse-integrity.js:5:8)
    at Module._compile (node:internal/modules/cjs/loader:1097:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47 {
  generatedMessage: false,
  code: 'ERR_ASSERTION',
  actual: undefined,
  expected: undefined,
  operator: 'fail'
}

Node.js v18.0.0-pre
Command: out/Release/node /home/lenovo/Desktop/node/node/test/parallel/test-policy-parse-integrity.js
=== release test-policy-crypto-default-encoding ===                
Path: parallel/test-policy-crypto-default-encoding
node:assert:170
  throw err;
  ^

AssertionError [ERR_ASSERTION]: This test shouldn't load properties from a package.json above its file location. Found package.json at /home/lenovo/package.json.
    at Proxy.requireNoPackageJSONAbove (/home/lenovo/Desktop/node/node/test/common/index.js:747:14)
    at Object.<anonymous> (/home/lenovo/Desktop/node/node/test/parallel/test-policy-crypto-default-encoding.js:6:8)
    at Module._compile (node:internal/modules/cjs/loader:1097:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47 {
  generatedMessage: false,
  code: 'ERR_ASSERTION',
  actual: undefined,
  expected: undefined,
  operator: 'fail'
}

Node.js v18.0.0-pre
Command: out/Release/node /home/lenovo/Desktop/node/node/test/parallel/test-policy-crypto-default-encoding.js
=== release test-policy-manifest ===                               
Path: parallel/test-policy-manifest
node:assert:170
  throw err;
  ^

AssertionError [ERR_ASSERTION]: This test shouldn't load properties from a package.json above its file location. Found package.json at /home/lenovo/package.json.
    at Proxy.requireNoPackageJSONAbove (/home/lenovo/Desktop/node/node/test/common/index.js:747:14)
    at Object.<anonymous> (/home/lenovo/Desktop/node/node/test/parallel/test-policy-manifest.js:8:8)
    at Module._compile (node:internal/modules/cjs/loader:1097:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47 {
  generatedMessage: false,
  code: 'ERR_ASSERTION',
  actual: undefined,
  expected: undefined,
  operator: 'fail'
}

Node.js v18.0.0-pre
Command: out/Release/node /home/lenovo/Desktop/node/node/test/parallel/test-policy-manifest.js
=== release test-policy-dependency-conditions ===               
Path: parallel/test-policy-dependency-conditions
node:assert:170
  throw err;
  ^

AssertionError [ERR_ASSERTION]: This test shouldn't load properties from a package.json above its file location. Found package.json at /home/lenovo/package.json.
    at Proxy.requireNoPackageJSONAbove (/home/lenovo/Desktop/node/node/test/common/index.js:747:14)
    at Object.<anonymous> (/home/lenovo/Desktop/node/node/test/parallel/test-policy-dependency-conditions.js:7:8)
    at Module._compile (node:internal/modules/cjs/loader:1097:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47 {
  generatedMessage: false,
  code: 'ERR_ASSERTION',
  actual: undefined,
  expected: undefined,
  operator: 'fail'
}

Node.js v18.0.0-pre
Command: out/Release/node --expose-internals /home/lenovo/Desktop/node/node/test/parallel/test-policy-dependency-conditions.js
=== release test-policy-dependencies ===                        
Path: parallel/test-policy-dependencies
node:assert:170
  throw err;
  ^

AssertionError [ERR_ASSERTION]: This test shouldn't load properties from a package.json above its file location. Found package.json at /home/lenovo/package.json.
    at Proxy.requireNoPackageJSONAbove (/home/lenovo/Desktop/node/node/test/common/index.js:747:14)
    at Object.<anonymous> (/home/lenovo/Desktop/node/node/test/parallel/test-policy-dependencies.js:6:8)
    at Module._compile (node:internal/modules/cjs/loader:1097:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47 {
  generatedMessage: false,
  code: 'ERR_ASSERTION',
  actual: undefined,
  expected: undefined,
  operator: 'fail'
}

Node.js v18.0.0-pre
Command: out/Release/node /home/lenovo/Desktop/node/node/test/parallel/test-policy-dependencies.js
=== release test-policy-scopes ===                                 
Path: parallel/test-policy-scopes
node:assert:170
  throw err;
  ^

AssertionError [ERR_ASSERTION]: This test shouldn't load properties from a package.json above its file location. Found package.json at /home/lenovo/package.json.
    at Proxy.requireNoPackageJSONAbove (/home/lenovo/Desktop/node/node/test/common/index.js:747:14)
    at Object.<anonymous> (/home/lenovo/Desktop/node/node/test/parallel/test-policy-scopes.js:6:8)
    at Module._compile (node:internal/modules/cjs/loader:1097:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47 {
  generatedMessage: false,
  code: 'ERR_ASSERTION',
  actual: undefined,
  expected: undefined,
  operator: 'fail'
}

Node.js v18.0.0-pre
Command: out/Release/node /home/lenovo/Desktop/node/node/test/parallel/test-policy-scopes.js
=== release test-policy-scopes-dependencies ===                  
Path: parallel/test-policy-scopes-dependencies
node:assert:170
  throw err;
  ^

AssertionError [ERR_ASSERTION]: This test shouldn't load properties from a package.json above its file location. Found package.json at /home/lenovo/package.json.
    at Proxy.requireNoPackageJSONAbove (/home/lenovo/Desktop/node/node/test/common/index.js:747:14)
    at Object.<anonymous> (/home/lenovo/Desktop/node/node/test/parallel/test-policy-scopes-dependencies.js:7:8)
    at Module._compile (node:internal/modules/cjs/loader:1097:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47 {
  generatedMessage: false,
  code: 'ERR_ASSERTION',
  actual: undefined,
  expected: undefined,
  operator: 'fail'
}

Node.js v18.0.0-pre
Command: out/Release/node --expose-internals /home/lenovo/Desktop/node/node/test/parallel/test-policy-scopes-dependencies.js
=== release test-policy-scopes-integrity ===              
Path: parallel/test-policy-scopes-integrity
node:assert:170
  throw err;
  ^

AssertionError [ERR_ASSERTION]: This test shouldn't load properties from a package.json above its file location. Found package.json at /home/lenovo/package.json.
    at Proxy.requireNoPackageJSONAbove (/home/lenovo/Desktop/node/node/test/common/index.js:747:14)
    at Object.<anonymous> (/home/lenovo/Desktop/node/node/test/parallel/test-policy-scopes-integrity.js:7:8)
    at Module._compile (node:internal/modules/cjs/loader:1097:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47 {
  generatedMessage: false,
  code: 'ERR_ASSERTION',
  actual: undefined,
  expected: undefined,
  operator: 'fail'
}

Node.js v18.0.0-pre
Command: out/Release/node --expose-internals /home/lenovo/Desktop/node/node/test/parallel/test-policy-scopes-integrity.js
=== release test_policy ===                                                   
Path: node-api/test_policy/test_policy
node:internal/policy/manifest:67
  throw error;
  ^

Error [ERR_MANIFEST_ASSERT_INTEGRITY]: The content of "file:///home/lenovo/package.json" does not match the expected integrity. The resource was not found in the policy.
    at new NodeError (node:internal/errors:371:5)
    at Manifest.assertIntegrity (node:internal/policy/manifest:593:19)
    at Object.read (node:internal/modules/package_json_reader:34:16)
    at readPackage (node:internal/modules/cjs/loader:296:36)
    at readPackageScope (node:internal/modules/cjs/loader:329:19)
    at shouldUseESMLoader (node:internal/modules/run_main:43:15)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:72:24)
    at node:internal/main/run_main_module:17:47 {
  code: 'ERR_MANIFEST_ASSERT_INTEGRITY'
}

Node.js v18.0.0-pre
node:assert:123
  throw new AssertionError(obj);
  ^

AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:

1 !== 0

    at test (/home/lenovo/Desktop/node/node/test/node-api/test_policy/test_policy.js:54:12)
    at Object.<anonymous> (/home/lenovo/Desktop/node/node/test/node-api/test_policy/test_policy.js:58:1)
    at Module._compile (node:internal/modules/cjs/loader:1097:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47 {
  generatedMessage: true,
  code: 'ERR_ASSERTION',
  actual: 1,
  expected: 0,
  operator: 'strictEqual'
}

Node.js v18.0.0-pre
Command: out/Release/node /home/lenovo/Desktop/node/node/test/node-api/test_policy/test_policy.js
[04:59|% 100|+ 3499|-  10]: Done                                              
make[1]: *** [Makefile:285: jstest] Error 1
make: *** [Makefile:311: test] Error 2

dollar22 added a commit to dollar22/node that referenced this issue Jan 31, 2022
@Mesteery
Copy link
Contributor

/cc @nodejs/process

@dollar22

This comment has been minimized.

@Mesteery

This comment has been minimized.

@dollar22

This comment has been minimized.

sxa pushed a commit to sxa/node that referenced this issue Mar 7, 2022
PR-URL: nodejs#41861
Fixes: nodejs#41774
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: James M Snell <[email protected]>
danielleadams pushed a commit to danielleadams/node that referenced this issue Apr 21, 2022
PR-URL: nodejs#41861
Fixes: nodejs#41774
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: James M Snell <[email protected]>
danielleadams pushed a commit that referenced this issue Apr 24, 2022
PR-URL: #41861
Fixes: #41774
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: James M Snell <[email protected]>
danielleadams pushed a commit that referenced this issue Apr 24, 2022
PR-URL: #41861
Fixes: #41774
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: James M Snell <[email protected]>
danielleadams pushed a commit that referenced this issue Apr 24, 2022
PR-URL: #41861
Fixes: #41774
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: James M Snell <[email protected]>
xtx1130 pushed a commit to xtx1130/node that referenced this issue Apr 25, 2022
PR-URL: nodejs#41861
Fixes: nodejs#41774
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
esm Issues and PRs related to the ECMAScript Modules implementation. process Issues and PRs related to the process subsystem.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants