anseki / vscode-color

Helper with GUI to generate color codes such as CSS color notations.
MIT License
97 stars 27 forks source link

[processBridge]: TypeError: must call as: npm.load(callback) #110

Closed geisonmcd closed 3 years ago

geisonmcd commented 3 years ago

Steps to Reproduce:

  1. In React Native styles select only the color code (without the #), for example the 'C4C4C6' in pickerDisabled: { color: '#C4C4C6', },
  2. Type <ctrl + shit + p> and type the command 'Pick Color' or hit <alt + c p>

Log (All lines): (Click menu of VS Code "Help > Toggle Developer Tools", and click "Console" tab)

[Extension Host] Start child process...
workbench.desktop.main.js:sourcemap:62 [Extension Host] Start initializing module...
v @ workbench.desktop.main.js:sourcemap:62
$logExtensionHostMessage @ workbench.desktop.main.js:sourcemap:1687
_doInvokeHandler @ workbench.desktop.main.js:sourcemap:1687
_invokeHandler @ workbench.desktop.main.js:sourcemap:1687
_receiveRequest @ workbench.desktop.main.js:sourcemap:1687
_receiveOneMessage @ workbench.desktop.main.js:sourcemap:1687
(anonymous) @ workbench.desktop.main.js:sourcemap:1687
fire @ workbench.desktop.main.js:sourcemap:57
fire @ workbench.desktop.main.js:sourcemap:76
_receiveMessage @ workbench.desktop.main.js:sourcemap:76
(anonymous) @ workbench.desktop.main.js:sourcemap:76
fire @ workbench.desktop.main.js:sourcemap:57
acceptChunk @ workbench.desktop.main.js:sourcemap:76
(anonymous) @ workbench.desktop.main.js:sourcemap:76
I @ workbench.desktop.main.js:sourcemap:2760
emit @ events.js:315
addChunk @ _stream_readable.js:295
readableAddChunk @ _stream_readable.js:271
Readable.push @ _stream_readable.js:212
onStreamRead @ internal/stream_base_commons.js:186
workbench.desktop.main.js:sourcemap:62 [Extension Host] Node.js@12.18.3
workbench.desktop.main.js:sourcemap:62 [Extension Host] Error: Cannot find module 'npm'Require stack:- /home/geison/.vscode/extensions/anseki.vscode-color-0.4.5/node_modules/process-bridge/process-bridge.js- /home/geison/.vscode/extensions/anseki.vscode-color-0.4.5/lib/color-helper.js- /home/geison/.vscode/extensions/anseki.vscode-color-0.4.5/extension.js- /usr/share/code/resources/app/out/vs/loader.js- /usr/share/code/resources/app/out/bootstrap-amd.js- /usr/share/code/resources/app/out/bootstrap-fork.js  at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1019:15)    at Module._load (internal/modules/cjs/loader.js:895:27) at Function.f._load (electron/js2c/asar_bundle.js:5:12738)  at Function.s._load (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:106:27167) at Function._._load (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:106:23919) at Function.W._load (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:96:4637)   at Module.require (internal/modules/cjs/loader.js:1079:19)  at v (/usr/share/code/resources/app/out/vs/loader.js:3:12287)   at getNpm (/home/geison/.vscode/extensions/anseki.vscode-color-0.4.5/node_modules/process-bridge/process-bridge.js:139:15)  at initModule (/home/geison/.vscode/extensions/anseki.vscode-color-0.4.5/node_modules/process-bridge/process-bridge.js:220:10)  at getHostCmd (/home/geison/.vscode/extensions/anseki.vscode-color-0.4.5/node_modules/process-bridge/process-bridge.js:331:9)   at /home/geison/.vscode/extensions/anseki.vscode-color-0.4.5/node_modules/process-bridge/process-bridge.js:394:19   at Object.exports.sendRequest (/home/geison/.vscode/extensions/anseki.vscode-color-0.4.5/node_modules/process-bridge/process-bridge.js:468:34)  at pickConvert (/home/geison/.vscode/extensions/anseki.vscode-color-0.4.5/lib/color-helper.js:187:15)   at exports.pick (/home/geison/.vscode/extensions/anseki.vscode-color-0.4.5/lib/color-helper.js:229:24)  at S._executeContributedCommand (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:87:103774) at S.$executeContributedCommand (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:87:104212) at c._doInvokeHandler (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:90:10509)    at c._invokeHandler (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:90:10201)  at c._receiveRequest (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:90:8871)  at c._receiveOneMessage (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:90:7673)   at /usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:90:5782  at g.fire (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:57:1836) at p.fire (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:65:15443)    at /usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:106:29119    at g.fire (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:57:1836) at p.fire (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:65:15443)    at t._receiveMessage (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:65:20693) at /usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:65:17587 at g.fire (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:57:1836) at l.acceptChunk (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:65:12808) at /usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:65:12156 at Socket.E (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:106:12375) at Socket.emit (events.js:315:20)   at Socket.EventEmitter.emit (domain.js:483:12)  at addChunk (_stream_readable.js:295:12)    at readableAddChunk (_stream_readable.js:271:9) at Socket.Readable.push (_stream_readable.js:212:10)    at Pipe.onStreamRead (internal/stream_base_commons.js:186:23)
workbench.desktop.main.js:sourcemap:62 [Extension Host] Continue trying to get NPM...
v @ workbench.desktop.main.js:sourcemap:62
$logExtensionHostMessage @ workbench.desktop.main.js:sourcemap:1687
_doInvokeHandler @ workbench.desktop.main.js:sourcemap:1687
_invokeHandler @ workbench.desktop.main.js:sourcemap:1687
_receiveRequest @ workbench.desktop.main.js:sourcemap:1687
_receiveOneMessage @ workbench.desktop.main.js:sourcemap:1687
(anonymous) @ workbench.desktop.main.js:sourcemap:1687
fire @ workbench.desktop.main.js:sourcemap:57
fire @ workbench.desktop.main.js:sourcemap:76
_receiveMessage @ workbench.desktop.main.js:sourcemap:76
(anonymous) @ workbench.desktop.main.js:sourcemap:76
fire @ workbench.desktop.main.js:sourcemap:57
acceptChunk @ workbench.desktop.main.js:sourcemap:76
(anonymous) @ workbench.desktop.main.js:sourcemap:76
I @ workbench.desktop.main.js:sourcemap:2760
emit @ events.js:315
addChunk @ _stream_readable.js:295
readableAddChunk @ _stream_readable.js:271
Readable.push @ _stream_readable.js:212
onStreamRead @ internal/stream_base_commons.js:186
workbench.desktop.main.js:sourcemap:62 [Extension Host] Try to get NPM via usage info.
v @ workbench.desktop.main.js:sourcemap:62
$logExtensionHostMessage @ workbench.desktop.main.js:sourcemap:1687
_doInvokeHandler @ workbench.desktop.main.js:sourcemap:1687
_invokeHandler @ workbench.desktop.main.js:sourcemap:1687
_receiveRequest @ workbench.desktop.main.js:sourcemap:1687
_receiveOneMessage @ workbench.desktop.main.js:sourcemap:1687
(anonymous) @ workbench.desktop.main.js:sourcemap:1687
fire @ workbench.desktop.main.js:sourcemap:57
fire @ workbench.desktop.main.js:sourcemap:76
_receiveMessage @ workbench.desktop.main.js:sourcemap:76
(anonymous) @ workbench.desktop.main.js:sourcemap:76
fire @ workbench.desktop.main.js:sourcemap:57
acceptChunk @ workbench.desktop.main.js:sourcemap:76
(anonymous) @ workbench.desktop.main.js:sourcemap:76
I @ workbench.desktop.main.js:sourcemap:2760
emit @ events.js:315
addChunk @ _stream_readable.js:295
readableAddChunk @ _stream_readable.js:271
Readable.push @ _stream_readable.js:212
onStreamRead @ internal/stream_base_commons.js:186
workbench.desktop.main.js:sourcemap:62 [Extension Host] NPM@7.5.4
workbench.desktop.main.js:sourcemap:62 [Extension Host] NPM directory path: /home/geison/.nvm/versions/node/v14.15.5/lib/node_modules/npm
workbench.desktop.main.js:sourcemap:62 [Extension Host] NPM resolved path: /home/geison/.nvm/versions/node/v14.15.5/lib/node_modules/npm/lib/npm.js
workbench.desktop.main.js:sourcemap:62 [Extension Host] Base directory path: /home/geison/.vscode/extensions/anseki.vscode-color-0.4.5
workbench.desktop.main.js:sourcemap:62 [Extension Host] TypeError: must call as: npm.load(callback) at Object.load (/home/geison/.nvm/versions/node/v14.15.5/lib/node_modules/npm/lib/npm.js:130:13)    at initModule (/home/geison/.vscode/extensions/anseki.vscode-color-0.4.5/node_modules/process-bridge/process-bridge.js:233:9)   at getHostCmd (/home/geison/.vscode/extensions/anseki.vscode-color-0.4.5/node_modules/process-bridge/process-bridge.js:331:9)   at /home/geison/.vscode/extensions/anseki.vscode-color-0.4.5/node_modules/process-bridge/process-bridge.js:394:19   at Object.exports.sendRequest (/home/geison/.vscode/extensions/anseki.vscode-color-0.4.5/node_modules/process-bridge/process-bridge.js:468:34)  at pickConvert (/home/geison/.vscode/extensions/anseki.vscode-color-0.4.5/lib/color-helper.js:187:15)   at exports.pick (/home/geison/.vscode/extensions/anseki.vscode-color-0.4.5/lib/color-helper.js:229:24)  at S._executeContributedCommand (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:87:103774) at S.$executeContributedCommand (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:87:104212) at c._doInvokeHandler (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:90:10509)    at c._invokeHandler (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:90:10201)  at c._receiveRequest (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:90:8871)  at c._receiveOneMessage (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:90:7673)   at /usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:90:5782  at g.fire (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:57:1836) at p.fire (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:65:15443)    at /usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:106:29119    at g.fire (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:57:1836) at p.fire (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:65:15443)    at t._receiveMessage (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:65:20693) at /usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:65:17587 at g.fire (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:57:1836) at l.acceptChunk (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:65:12808) at /usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:65:12156 at Socket.E (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:106:12375) at Socket.emit (events.js:315:20)   at Socket.EventEmitter.emit (domain.js:483:12)  at addChunk (_stream_readable.js:295:12)    at readableAddChunk (_stream_readable.js:271:9) at Socket.Readable.push (_stream_readable.js:212:10)    at Pipe.onStreamRead (internal/stream_base_commons.js:186:23)
v @ workbench.desktop.main.js:sourcemap:62
$logExtensionHostMessage @ workbench.desktop.main.js:sourcemap:1687
_doInvokeHandler @ workbench.desktop.main.js:sourcemap:1687
_invokeHandler @ workbench.desktop.main.js:sourcemap:1687
_receiveRequest @ workbench.desktop.main.js:sourcemap:1687
_receiveOneMessage @ workbench.desktop.main.js:sourcemap:1687
(anonymous) @ workbench.desktop.main.js:sourcemap:1687
fire @ workbench.desktop.main.js:sourcemap:57
fire @ workbench.desktop.main.js:sourcemap:76
_receiveMessage @ workbench.desktop.main.js:sourcemap:76
(anonymous) @ workbench.desktop.main.js:sourcemap:76
fire @ workbench.desktop.main.js:sourcemap:57
acceptChunk @ workbench.desktop.main.js:sourcemap:76
(anonymous) @ workbench.desktop.main.js:sourcemap:76
I @ workbench.desktop.main.js:sourcemap:2760
emit @ events.js:315
addChunk @ _stream_readable.js:295
readableAddChunk @ _stream_readable.js:271
Readable.push @ _stream_readable.js:212
onStreamRead @ internal/stream_base_commons.js:186
workbench.desktop.main.js:sourcemap:731 [processBridge]: TypeError: must call as: npm.load(callback)
onDidChangeNotification @ workbench.desktop.main.js:sourcemap:731
(anonymous) @ workbench.desktop.main.js:sourcemap:731
fire @ workbench.desktop.main.js:sourcemap:57
addNotification @ workbench.desktop.main.js:sourcemap:733
notify @ workbench.desktop.main.js:sourcemap:1725
(anonymous) @ workbench.desktop.main.js:sourcemap:1680
_showMessage @ workbench.desktop.main.js:sourcemap:1680
$showMessage @ workbench.desktop.main.js:sourcemap:1680
_doInvokeHandler @ workbench.desktop.main.js:sourcemap:1687
_invokeHandler @ workbench.desktop.main.js:sourcemap:1687
_receiveRequest @ workbench.desktop.main.js:sourcemap:1687
_receiveOneMessage @ workbench.desktop.main.js:sourcemap:1687
(anonymous) @ workbench.desktop.main.js:sourcemap:1687
fire @ workbench.desktop.main.js:sourcemap:57
fire @ workbench.desktop.main.js:sourcemap:76
_receiveMessage @ workbench.desktop.main.js:sourcemap:76
(anonymous) @ workbench.desktop.main.js:sourcemap:76
fire @ workbench.desktop.main.js:sourcemap:57
acceptChunk @ workbench.desktop.main.js:sourcemap:76
(anonymous) @ workbench.desktop.main.js:sourcemap:76
I @ workbench.desktop.main.js:sourcemap:2760
emit @ events.js:315
addChunk @ _stream_readable.js:295
readableAddChunk @ _stream_readable.js:271
Readable.push @ _stream_readable.js:212
onStreamRead @ internal/stream_base_commons.js:186
geisonmcd commented 3 years ago

I suspect it's my node version since in the log says

Node.js@12.18.3
workbench.desktop.main.js:sourcemap:62 [Extension Host] Error: Cannot find module 'npm'

and I'm using node 14, but I'm just guessing and don't know how to fix.

anseki commented 3 years ago

Hi @geisonmcd, thank you for the comment. Try this: https://github.com/anseki/vscode-color/issues/108#issuecomment-774365209

anseki commented 3 years ago

No reply came, then this abandoned issue is closed.