{"id":1940,"date":"2014-12-18T10:02:14","date_gmt":"2014-12-18T15:02:14","guid":{"rendered":"http:\/\/www.shieldadvanced.com\/Blog\/?p=1940"},"modified":"2014-12-18T10:02:14","modified_gmt":"2014-12-18T15:02:14","slug":"adding-path-variables-for-node-js-and-npm","status":"publish","type":"post","link":"https:\/\/www.shieldadvanced.com\/Blog\/adding-path-variables-for-node-js-and-npm\/","title":{"rendered":"Adding Path variables for Node.js and npm"},"content":{"rendered":"<p>I broke the LinkedIn Node.js group discussion board otherwise I would have put this information there. I have finally worked out what the problem is with the path set up when trying to use Node Package Manager (npm) on the IBM i. The problem started with how I was trying to set the PATH variable in the shell, it appears that the BASH shell does not like the &#8216;export PATH=$PATH:\/newpath&#8217; request, it always sends back an invalid identifier message and does not set the PATH variable. After some Google work I found a number of forum posts where others had fallen into this trap, the problem is the way that BASH interprets the $variable settings.<\/p>\n<p>I am not really clear on why the BASH shell is the problem but I did find a work around. If you set the variable and then export it the variable is correctly set for the environment, so &#8216;PATH=$PATH:\/newpath&#8217; and then &#8216;export PATH&#8217; works just fine.  This was not the end of it though because even though I has set the PATH variable correctly for the environment the npm requests did not run and complained about libstdc++.a not being found! Running the request in the ..\/Node\/bin directory did allow the request to run correctly but being outside that directory did not. I did some more research and found that the way to get around this is to set the LD_LIBRARY_PATH so it picks up the objects in the ..\/Node\/bin library. This is done as above by setting the variable and then exporting it ie: &#8216;LD_LIBRARY_PATH=\/QOpenSys\/QIBM\/ProdData\/Node\/bin&#8217; and then &#8216;export LD_LIBRARY_PATH&#8217;<\/p>\n<p>I will now build a .profile in my home directory to set these on starting the terminal session..<\/p>\n<p>Chris&#8230;  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>I broke the LinkedIn Node.js group discussion board otherwise I would have put this information there. I have finally worked out what the problem is with the path set up when trying to use Node [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,13,15,25,31],"tags":[],"class_list":["post-1940","post","type-post","status-publish","format-standard","hentry","category-application-modernization","category-ibm-i","category-javascript","category-node-js","category-power7"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Adding Path variables for Node.js and npm - Simply i<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.shieldadvanced.com\/Blog\/adding-path-variables-for-node-js-and-npm\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Adding Path variables for Node.js and npm - Simply i\" \/>\n<meta property=\"og:description\" content=\"I broke the LinkedIn Node.js group discussion board otherwise I would have put this information there. I have finally worked out what the problem is with the path set up when trying to use Node [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.shieldadvanced.com\/Blog\/adding-path-variables-for-node-js-and-npm\/\" \/>\n<meta property=\"og:site_name\" content=\"Simply i\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/facebook.com\/shieldadvanced\" \/>\n<meta property=\"article:published_time\" content=\"2014-12-18T15:02:14+00:00\" \/>\n<meta name=\"author\" content=\"Chris Hird\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Chris Hird\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.shieldadvanced.com\\\/Blog\\\/adding-path-variables-for-node-js-and-npm\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.shieldadvanced.com\\\/Blog\\\/adding-path-variables-for-node-js-and-npm\\\/\"},\"author\":{\"name\":\"Chris Hird\",\"@id\":\"https:\\\/\\\/www.shieldadvanced.com\\\/Blog\\\/#\\\/schema\\\/person\\\/5277cc6ead0c8417f74194f8e318bd69\"},\"headline\":\"Adding Path variables for Node.js and npm\",\"datePublished\":\"2014-12-18T15:02:14+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.shieldadvanced.com\\\/Blog\\\/adding-path-variables-for-node-js-and-npm\\\/\"},\"wordCount\":310,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.shieldadvanced.com\\\/Blog\\\/#organization\"},\"articleSection\":[\"Application Modernization\",\"IBM i\",\"JavaScript\",\"node.js\",\"Power7+\"],\"inLanguage\":\"en\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.shieldadvanced.com\\\/Blog\\\/adding-path-variables-for-node-js-and-npm\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.shieldadvanced.com\\\/Blog\\\/adding-path-variables-for-node-js-and-npm\\\/\",\"url\":\"https:\\\/\\\/www.shieldadvanced.com\\\/Blog\\\/adding-path-variables-for-node-js-and-npm\\\/\",\"name\":\"Adding Path variables for Node.js and npm - Simply i\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.shieldadvanced.com\\\/Blog\\\/#website\"},\"datePublished\":\"2014-12-18T15:02:14+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.shieldadvanced.com\\\/Blog\\\/adding-path-variables-for-node-js-and-npm\\\/#breadcrumb\"},\"inLanguage\":\"en\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.shieldadvanced.com\\\/Blog\\\/adding-path-variables-for-node-js-and-npm\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.shieldadvanced.com\\\/Blog\\\/adding-path-variables-for-node-js-and-npm\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.shieldadvanced.com\\\/Blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Adding Path variables for Node.js and npm\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.shieldadvanced.com\\\/Blog\\\/#website\",\"url\":\"https:\\\/\\\/www.shieldadvanced.com\\\/Blog\\\/\",\"name\":\"Simply i\",\"description\":\"All things IBM i\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.shieldadvanced.com\\\/Blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.shieldadvanced.com\\\/Blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.shieldadvanced.com\\\/Blog\\\/#organization\",\"name\":\"Simply i\",\"url\":\"https:\\\/\\\/www.shieldadvanced.com\\\/Blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en\",\"@id\":\"https:\\\/\\\/www.shieldadvanced.com\\\/Blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.shieldadvanced.com\\\/Blog\\\/wp-content\\\/uploads\\\/2020\\\/02\\\/cropped-LOGO_LARGE.png\",\"contentUrl\":\"https:\\\/\\\/www.shieldadvanced.com\\\/Blog\\\/wp-content\\\/uploads\\\/2020\\\/02\\\/cropped-LOGO_LARGE.png\",\"width\":240,\"height\":67,\"caption\":\"Simply i\"},\"image\":{\"@id\":\"https:\\\/\\\/www.shieldadvanced.com\\\/Blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/facebook.com\\\/shieldadvanced\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/10057076\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.shieldadvanced.com\\\/Blog\\\/#\\\/schema\\\/person\\\/5277cc6ead0c8417f74194f8e318bd69\",\"name\":\"Chris Hird\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en\",\"@id\":\"https:\\\/\\\/www.shieldadvanced.com\\\/Blog\\\/wp-content\\\/uploads\\\/2008\\\/12\\\/c_hird_11-96x96.jpg\",\"url\":\"https:\\\/\\\/www.shieldadvanced.com\\\/Blog\\\/wp-content\\\/uploads\\\/2008\\\/12\\\/c_hird_11-96x96.jpg\",\"contentUrl\":\"https:\\\/\\\/www.shieldadvanced.com\\\/Blog\\\/wp-content\\\/uploads\\\/2008\\\/12\\\/c_hird_11-96x96.jpg\",\"caption\":\"Chris Hird\"},\"url\":\"https:\\\/\\\/www.shieldadvanced.com\\\/Blog\\\/author\\\/admin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Adding Path variables for Node.js and npm - Simply i","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.shieldadvanced.com\/Blog\/adding-path-variables-for-node-js-and-npm\/","og_locale":"en_US","og_type":"article","og_title":"Adding Path variables for Node.js and npm - Simply i","og_description":"I broke the LinkedIn Node.js group discussion board otherwise I would have put this information there. I have finally worked out what the problem is with the path set up when trying to use Node [&hellip;]","og_url":"https:\/\/www.shieldadvanced.com\/Blog\/adding-path-variables-for-node-js-and-npm\/","og_site_name":"Simply i","article_publisher":"https:\/\/facebook.com\/shieldadvanced","article_published_time":"2014-12-18T15:02:14+00:00","author":"Chris Hird","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Chris Hird","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.shieldadvanced.com\/Blog\/adding-path-variables-for-node-js-and-npm\/#article","isPartOf":{"@id":"https:\/\/www.shieldadvanced.com\/Blog\/adding-path-variables-for-node-js-and-npm\/"},"author":{"name":"Chris Hird","@id":"https:\/\/www.shieldadvanced.com\/Blog\/#\/schema\/person\/5277cc6ead0c8417f74194f8e318bd69"},"headline":"Adding Path variables for Node.js and npm","datePublished":"2014-12-18T15:02:14+00:00","mainEntityOfPage":{"@id":"https:\/\/www.shieldadvanced.com\/Blog\/adding-path-variables-for-node-js-and-npm\/"},"wordCount":310,"commentCount":0,"publisher":{"@id":"https:\/\/www.shieldadvanced.com\/Blog\/#organization"},"articleSection":["Application Modernization","IBM i","JavaScript","node.js","Power7+"],"inLanguage":"en","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.shieldadvanced.com\/Blog\/adding-path-variables-for-node-js-and-npm\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.shieldadvanced.com\/Blog\/adding-path-variables-for-node-js-and-npm\/","url":"https:\/\/www.shieldadvanced.com\/Blog\/adding-path-variables-for-node-js-and-npm\/","name":"Adding Path variables for Node.js and npm - Simply i","isPartOf":{"@id":"https:\/\/www.shieldadvanced.com\/Blog\/#website"},"datePublished":"2014-12-18T15:02:14+00:00","breadcrumb":{"@id":"https:\/\/www.shieldadvanced.com\/Blog\/adding-path-variables-for-node-js-and-npm\/#breadcrumb"},"inLanguage":"en","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.shieldadvanced.com\/Blog\/adding-path-variables-for-node-js-and-npm\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.shieldadvanced.com\/Blog\/adding-path-variables-for-node-js-and-npm\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.shieldadvanced.com\/Blog\/"},{"@type":"ListItem","position":2,"name":"Adding Path variables for Node.js and npm"}]},{"@type":"WebSite","@id":"https:\/\/www.shieldadvanced.com\/Blog\/#website","url":"https:\/\/www.shieldadvanced.com\/Blog\/","name":"Simply i","description":"All things IBM i","publisher":{"@id":"https:\/\/www.shieldadvanced.com\/Blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.shieldadvanced.com\/Blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en"},{"@type":"Organization","@id":"https:\/\/www.shieldadvanced.com\/Blog\/#organization","name":"Simply i","url":"https:\/\/www.shieldadvanced.com\/Blog\/","logo":{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/www.shieldadvanced.com\/Blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.shieldadvanced.com\/Blog\/wp-content\/uploads\/2020\/02\/cropped-LOGO_LARGE.png","contentUrl":"https:\/\/www.shieldadvanced.com\/Blog\/wp-content\/uploads\/2020\/02\/cropped-LOGO_LARGE.png","width":240,"height":67,"caption":"Simply i"},"image":{"@id":"https:\/\/www.shieldadvanced.com\/Blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/facebook.com\/shieldadvanced","https:\/\/www.linkedin.com\/company\/10057076"]},{"@type":"Person","@id":"https:\/\/www.shieldadvanced.com\/Blog\/#\/schema\/person\/5277cc6ead0c8417f74194f8e318bd69","name":"Chris Hird","image":{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/www.shieldadvanced.com\/Blog\/wp-content\/uploads\/2008\/12\/c_hird_11-96x96.jpg","url":"https:\/\/www.shieldadvanced.com\/Blog\/wp-content\/uploads\/2008\/12\/c_hird_11-96x96.jpg","contentUrl":"https:\/\/www.shieldadvanced.com\/Blog\/wp-content\/uploads\/2008\/12\/c_hird_11-96x96.jpg","caption":"Chris Hird"},"url":"https:\/\/www.shieldadvanced.com\/Blog\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.shieldadvanced.com\/Blog\/wp-json\/wp\/v2\/posts\/1940","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.shieldadvanced.com\/Blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shieldadvanced.com\/Blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shieldadvanced.com\/Blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shieldadvanced.com\/Blog\/wp-json\/wp\/v2\/comments?post=1940"}],"version-history":[{"count":0,"href":"https:\/\/www.shieldadvanced.com\/Blog\/wp-json\/wp\/v2\/posts\/1940\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.shieldadvanced.com\/Blog\/wp-json\/wp\/v2\/media?parent=1940"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shieldadvanced.com\/Blog\/wp-json\/wp\/v2\/categories?post=1940"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shieldadvanced.com\/Blog\/wp-json\/wp\/v2\/tags?post=1940"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}