Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nodejs reading file ENAMETOOLONG

Tags:

node.js

fs

I am trying to use const config = fs.readFileSync(configFilePath,'utf8');

But It actually returned me an error that is mentioned below:

fs.js:663
  return binding.open(pathModule.toNamespacedPath(path),
                 ^

Error: ENAMETOOLONG: name too long, open '/Users/akshaysood/Blockchain/fabricSDK/dist/name: "Network"
version: "1.0"

The file that I am trying to read is available at https://hastebin.com/ubaqakixit.http

I am new to node.js. If anyone knows this error please let me know

like image 315
Akshay Sood Avatar asked Aug 15 '18 15:08

Akshay Sood


1 Answers

The node sdk accepts Yaml file path as input, instead of accepts Yaml file content. So it should be

const path = require('path');
const config= path.resolve(configFilePath);

to go on

like image 131
刘宇翔 Avatar answered Oct 18 '22 05:10

刘宇翔