Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
read package.json correctly as object
Browse files Browse the repository at this point in the history
Luke-Roy-IBM committed Mar 9, 2023
1 parent d6616f6 commit 4c14d71
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/nodejsActionBase/runner.js
Original file line number Diff line number Diff line change
@@ -49,7 +49,7 @@ function initializeActionHandler(message) {
// install npm modules during init if source code zip doesn´t containt them
// check if package.json exists and node_modules don`t
if (fs.existsSync('package.json') && !fs.existsSync('./node_modules/')) {
var package_json = require('package.json');
var package_json = JSON.parse(fs.readFileSync('package.json', 'utf8'));
if (package_json.hasOwnProperty('dependencies')) {
if (Object.keys(package_json.dependencies).length > 0) {
exec("npm install")

0 comments on commit 4c14d71

Please sign in to comment.