<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How do I add a npm module to the server environment?]]></title><description><![CDATA[<p>I want to make the google-palette module available for use with Chart.js.  I assumed I would just need to do an &quot;npm install&quot; for the module in the jsreport folder, but my scripts don't seem to be able to find it via require.  I have the option  &quot;allowLocalFilesAccess&quot; set to true.  Any ideas?</p>
]]></description><link>https://forum.jsreport.net/topic/833/how-do-i-add-a-npm-module-to-the-server-environment</link><generator>RSS for Node</generator><lastBuildDate>Sun, 17 May 2026 11:54:54 GMT</lastBuildDate><atom:link href="https://forum.jsreport.net/topic/833.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 29 Nov 2018 15:19:51 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How do I add a npm module to the server environment? on Invalid Date]]></title><description><![CDATA[<p>I want to make the google-palette module available for use with Chart.js.  I assumed I would just need to do an &quot;npm install&quot; for the module in the jsreport folder, but my scripts don't seem to be able to find it via require.  I have the option  &quot;allowLocalFilesAccess&quot; set to true.  Any ideas?</p>
]]></description><link>https://forum.jsreport.net/post/4045</link><guid isPermaLink="true">https://forum.jsreport.net/post/4045</guid><dc:creator><![CDATA[halindrome]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to How do I add a npm module to the server environment? on Invalid Date]]></title><description><![CDATA[<p>hi! hmm that should work.. can you share what is the jsreport version you are using? and also can you share all the logs that you get from starting jsreport until you render the report and get the error about not finding <code>google-palette</code> module?</p>
]]></description><link>https://forum.jsreport.net/post/4047</link><guid isPermaLink="true">https://forum.jsreport.net/post/4047</guid><dc:creator><![CDATA[bjrmatos]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to How do I add a npm module to the server environment? on Invalid Date]]></title><description><![CDATA[<p>We are using 2.2.0 - just installed yesterday actually.</p>
<p>I have stopped the server, cleared the logs, and restarted.</p>
<pre><code>jsreport@localhost:/var/jsreport$ jsreport start
2018-11-29T16:54:33.179Z - info: Initializing jsreport@2.2.0 in development mode using configuration file: jsreport.config.json
2018-11-29T16:54:33.182Z - info: Searching for available extensions in /var/jsreport/
2018-11-29T16:54:33.192Z - info: Extensions location cache contains up to date information, skipping crawling in /var/jsreport/
2018-11-29T16:54:33.197Z - info: Found 31 extensions
2018-11-29T16:54:33.212Z - debug: Writing extension locations cache to /tmp/jsreport/core/locations.json
2018-11-29T16:54:33.214Z - debug: Discovered 31 extensions
2018-11-29T16:54:33.511Z - info: Using extension handlebars
2018-11-29T16:54:33.517Z - info: Using extension import-export
2018-11-29T16:54:33.619Z - info: Using extension templates
2018-11-29T16:54:33.621Z - info: Using extension jsrender
2018-11-29T16:54:33.622Z - info: Using extension authentication
2018-11-29T16:54:33.654Z - info: Using extension freeze
2018-11-29T16:54:33.656Z - info: Using extension cli
2018-11-29T16:54:33.657Z - info: Using extension express
2018-11-29T16:54:33.749Z - info: Using extension debug
2018-11-29T16:54:33.751Z - info: Using extension tags
2018-11-29T16:54:33.753Z - info: Using extension data
2018-11-29T16:54:33.755Z - info: Using extension fs-store
2018-11-29T16:54:33.909Z - info: Using extension authorization
2018-11-29T16:54:33.911Z - info: Using extension html-to-xlsx
2018-11-29T16:54:34.026Z - info: html-to-xlsx detected chrome as available html engine
2018-11-29T16:54:34.026Z - info: Using extension child-templates
2018-11-29T16:54:34.028Z - info: Using extension browser-client
2018-11-29T16:54:34.030Z - info: Using extension chrome-pdf
2018-11-29T16:54:34.035Z - info: Using extension pdf-utils
2018-11-29T16:54:34.037Z - info: Using extension version-control
2018-11-29T16:54:34.062Z - info: Using extension reports
2018-11-29T16:54:34.066Z - info: Using extension text
2018-11-29T16:54:34.066Z - info: Using extension base
2018-11-29T16:54:34.068Z - info: Using extension studio
2018-11-29T16:54:34.086Z - info: Using extension licensing
2018-11-29T16:54:34.100Z - info: Using extension scripts
2018-11-29T16:54:34.103Z - info: Using extension assets
2018-11-29T16:54:34.109Z - info: Using extension scheduling
2018-11-29T16:54:34.153Z - info: Using extension xlsx
2018-11-29T16:54:34.200Z - info: Using extension sample-template
2018-11-29T16:54:34.202Z - info: Using extension resources
2018-11-29T16:54:34.203Z - info: Using extension public-templates
2018-11-29T16:54:34.210Z - info: fs store is persisting using fs
2018-11-29T16:54:34.211Z - info: fs store is synchronizing using fs
2018-11-29T16:54:34.238Z - info: fs store is loading data
2018-11-29T16:54:34.290Z - debug: fs store sync is configured to use polling for files watcher
2018-11-29T16:54:34.340Z - info: fs store is initialized successfully
2018-11-29T16:54:34.362Z - info: Creating default express app.
2018-11-29T16:54:34.384Z - info: jsreport server successfully started on http port: 8080
2018-11-29T16:54:34.385Z - info: fs store emits sockets to synchronize underlying changes with studio
2018-11-29T16:54:34.401Z - info: Verifying license key free
2018-11-29T16:54:34.402Z - info: Using free license
2018-11-29T16:54:34.405Z - info: reporter initialized
2018-11-29T16:55:15.540Z - info: Starting rendering request 1 (user: admin)
2018-11-29T16:55:15.543Z - info: Rendering template { name: time_in_zone, recipe: html-with-browser-client, engine: handlebars, preview: true }
2018-11-29T16:55:15.544Z - debug: Data item not defined for this template.
2018-11-29T16:55:15.545Z - debug: Resources not defined for this template.
2018-11-29T16:55:15.550Z - debug: Executing script fetcher
2018-11-29T16:55:16.893Z - debug: Base url not specified, skipping its injection.
2018-11-29T16:55:16.894Z - debug: Rendering engine handlebars
2018-11-29T16:55:17.017Z - debug: Compiled template not found in the cache, compiling
2018-11-29T16:55:17.057Z - debug: Executing recipe html-with-browser-client
2018-11-29T16:55:17.079Z - debug: Skipping storing report.
2018-11-29T16:55:17.096Z - info: Rendering request 1 finished in 1555 ms
2018-11-29T16:55:32.463Z - info: Starting rendering request 2 (user: admin)
2018-11-29T16:55:32.464Z - info: Rendering template { name: time_in_zone, recipe: html-with-browser-client, engine: handlebars, preview: true }
2018-11-29T16:55:32.464Z - debug: Data item not defined for this template.
2018-11-29T16:55:32.465Z - debug: Resources not defined for this template.
2018-11-29T16:55:32.466Z - debug: Executing script fetcher
2018-11-29T16:55:33.515Z - debug: Base url not specified, skipping its injection.
2018-11-29T16:55:33.516Z - debug: Rendering engine handlebars
2018-11-29T16:55:33.561Z - debug: Taking compiled template from engine cache
2018-11-29T16:55:33.573Z - debug: Executing recipe html-with-browser-client
2018-11-29T16:55:33.604Z - debug: Skipping storing report.
2018-11-29T16:55:33.642Z - info: Rendering request 2 finished in 1179 ms
2018-11-29T16:55:54.099Z - debug: OData update on scripts
2018-11-29T16:55:55.796Z - debug: OData update on assets
2018-11-29T16:55:58.615Z - info: Starting rendering request 3 (user: admin)
2018-11-29T16:55:58.616Z - info: Rendering template { name: time_in_zone, recipe: html-with-browser-client, engine: handlebars, preview: true }
2018-11-29T16:55:58.617Z - debug: Data item not defined for this template.
2018-11-29T16:55:58.617Z - debug: Resources not defined for this template.
2018-11-29T16:55:58.626Z - debug: Executing script fetcher
2018-11-29T16:55:59.685Z - debug: Base url not specified, skipping its injection.
2018-11-29T16:55:59.685Z - debug: Rendering engine handlebars
2018-11-29T16:55:59.740Z - warn: Error when processing render request Error while executing templating engine. Unable to find module palette
Searched paths:
palette
palette
/var/jsreport/palette
/var/jsreport/palette
/var/jsreport/node_modules/jsreport-cli/lib/palette
.

   5 |
   6 | var handlebars = require('handlebars');
&gt;  7 | var palette = require('palette');
     |               ^
   8 |
   9 | function zoneName(zoneinfo, zoneID) {
  10 |     if (arguments.length &lt; 2)

 Error: Unable to find module palette
Searched paths:
palette
palette
/var/jsreport/palette
/var/jsreport/palette
/var/jsreport/node_modules/jsreport-cli/lib/palette

    at doRequire (/var/jsreport/node_modules/jsreport-core/lib/render/safeSandbox.js:213:11)
    at _require (/var/jsreport/node_modules/jsreport-core/lib/render/safeSandbox.js:54:14)
    at Object.apply (/var/jsreport/node_modules/vm2/lib/contextify.js:288:34)
    at evaluate-template-engine-helpers.js:7:15
    at Script.runInContext (vm.js:107:20)
    at VM.run (/var/jsreport/node_modules/vm2/lib/main.js:212:72)
    at run (/var/jsreport/node_modules/jsreport-core/lib/render/safeSandbox.js:171:19)
    at module.exports (/var/jsreport/node_modules/jsreport-core/lib/render/engineScript.js:114:7)
    at IncomingMessage.&lt;anonymous&gt; (/var/jsreport/node_modules/script-manager/lib/worker-servers.js:239:47)
    at IncomingMessage.emit (events.js:182:13)
    at IncomingMessage.EventEmitter.emit (domain.js:460:23)
    at endReadableNT (_stream_readable.js:1094:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
2018-11-29T16:55:59.743Z - warn: Error during processing request at http://reporting.corvexconnected.com:8080/api/report/time_in_zone
</code></pre>
]]></description><link>https://forum.jsreport.net/post/4048</link><guid isPermaLink="true">https://forum.jsreport.net/post/4048</guid><dc:creator><![CDATA[halindrome]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to How do I add a npm module to the server environment? on Thu, 29 Nov 2018 20:56:16 GMT]]></title><description><![CDATA[<p>hmm i replicated your same directory structure (project on <code>/var/jsreport</code>) and started jsreport in the same way (using <code>jsreport start</code>) on my machine (OSX) and i can only see that error when i actually don't have the <code>palette</code> module installed. when the <code>palette</code> is installed on my project (<code>/var/jsreport</code>) then i can run the script normally. are you sure you installed <code>palette</code> correctly on <code>/var/jsreport</code>, for example for me the install of <code>palette</code> required to have some other low level packages listed <a href="https://github.com/Automattic/node-canvas#compiling" rel="nofollow">here</a>, after having those low level things in my machine the install of <code>palette</code> was ok. another check will be to run the <code>npm ls palette</code> command on the <code>/var/jsreport-test</code> directory. you should see a result like this:</p>
<pre><code>jsreport-server@ /var/jsreport-test
└── palette@0.1.1
</code></pre>
]]></description><link>https://forum.jsreport.net/post/4052</link><guid isPermaLink="true">https://forum.jsreport.net/post/4052</guid><dc:creator><![CDATA[bjrmatos]]></dc:creator><pubDate>Thu, 29 Nov 2018 20:56:16 GMT</pubDate></item><item><title><![CDATA[Reply to How do I add a npm module to the server environment? on Invalid Date]]></title><description><![CDATA[<p>another weird things, why your logs show other two requests correctly completed before failing in the third request? was the report working before? or does the report render some child templates, header or footer when it is being run?</p>
]]></description><link>https://forum.jsreport.net/post/4053</link><guid isPermaLink="true">https://forum.jsreport.net/post/4053</guid><dc:creator><![CDATA[bjrmatos]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to How do I add a npm module to the server environment? on Invalid Date]]></title><description><![CDATA[<p>The script had an early error check on its parameters that was backward, so it was failing off a legitimate request.</p>
]]></description><link>https://forum.jsreport.net/post/4054</link><guid isPermaLink="true">https://forum.jsreport.net/post/4054</guid><dc:creator><![CDATA[halindrome]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to How do I add a npm module to the server environment? on Invalid Date]]></title><description><![CDATA[<p>Also.. wow.  so the module is called google-palette.  And I installed that.  And then I referenced it as the wrong thing in the require statement.   Yikes.  I need a nap!   Thanks for your assistance!</p>
]]></description><link>https://forum.jsreport.net/post/4055</link><guid isPermaLink="true">https://forum.jsreport.net/post/4055</guid><dc:creator><![CDATA[halindrome]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>