Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Node JS error: "require is not defined"

Enthusiast ,
Mar 07, 2018 Mar 07, 2018

I'm not sure when it stopped being an available function, but at one point I was able to run Node JS "require" command in the browser context.

So the following...

require("child_process");

...used to work, but now returns an error: "Uncaught ReferenceError: require is not defined"

The manifest.xml does include the two lines (Per David Barranca's HTML Panel Tips #19: CC2015.1 (CEP6.1) Node.js Fixes | Photoshop, etc. )

<Parameter>--enable-nodejs</Parameter>

<Parameter>--mixed-context</Parameter>

Did something change?  Any ideas why it would have stopped working?

TOPICS
SDK
11.9K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Enthusiast , Mar 07, 2018 Mar 07, 2018

Solution:

replaced

require();

with

cep_node.require();

Thanks to to eyali.av for the posting cep_node context for the clue.

Translate
Enthusiast ,
Mar 07, 2018 Mar 07, 2018
LATEST

Solution:

replaced

require();

with

cep_node.require();

Thanks to to eyali.av for the posting cep_node context for the clue.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines