Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Cannot find module 'form-data' #8

Open
namnetes opened this issue Nov 19, 2020 · 3 comments
Open

Error: Cannot find module 'form-data' #8

namnetes opened this issue Nov 19, 2020 · 3 comments

Comments

@namnetes
Copy link

namnetes commented Nov 19, 2020

Hello,

Below the error when starting the process : npm start

> [email protected] start /u/MYUSER/nodejs/cics/cics-nodejs-invoke/projects/cics-nodejs-invoke                              
> node server.js                                                                                                                    
                                                                                                                                    
iconv-lite warning: javascript files use encoding different from utf-8. See https://github.com/ashtuchkin/iconv-lite/wiki/Javascript
-source-file-encodings for more info.                                                                                               
internal/modules/cjs/loader.js:969                                                                                                  
  throw err;                                                                                                                        
  ^                                                                                                                                 
                                                                                                                                    
Error: Cannot find module 'form-data'                                                                                               
Require stack:                                                                                                                      
- /u/MYUSER/nodejs/cics/cics-nodejs-invoke/projects/cics-nodejs-invoke/node_modules/request/request.js                             
- /u/MYUSER/nodejs/cics/cics-nodejs-invoke/projects/cics-nodejs-invoke/node_modules/request/index.js                               
- /u/MYUSER/nodejs/cics/cics-nodejs-invoke/projects/cics-nodejs-invoke/node_modules/ibm-cics-api/index.js                          
- /u/MYUSER/nodejs/cics/cics-nodejs-invoke/projects/cics-nodejs-invoke/server.js                                                   
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:966:15)                                                     
    at Function.Module._load (internal/modules/cjs/loader.js:842:27)                                                                
    at Module.require (internal/modules/cjs/loader.js:1026:19)                                                                      
    at require (internal/modules/cjs/helpers.js:72:18)                                                                              
    at Object.<anonymous> (/u/MYUSER/nodejs/cics/cics-nodejs-invoke/projects/cics-nodejs-invoke/node_modules/request/request.js:15:
16)                                                                                                                                 
    at Module._compile (internal/modules/cjs/loader.js:1138:30)                                                                     
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10) 
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)                                           
    at Module.load (internal/modules/cjs/loader.js:986:32)                                                              
    at Function.Module._load (internal/modules/cjs/loader.js:879:14)                                                    
    at Module.require (internal/modules/cjs/loader.js:1026:19) {                                                        
  code: 'MODULE_NOT_FOUND',                                                                                             
  requireStack: Y                                                                                                       
    '/u/MYUSER/nodejs/cics/cics-nodejs-invoke/projects/cics-nodejs-invoke/node_modules/request/request.js',            
    '/u/MYUSER/nodejs/cics/cics-nodejs-invoke/projects/cics-nodejs-invoke/node_modules/request/index.js',              
    '/u/MYUSER/nodejs/cics/cics-nodejs-invoke/projects/cics-nodejs-invoke/node_modules/ibm-cics-api/index.js',         
    '/u/MYUSER/nodejs/cics/cics-nodejs-invoke/projects/cics-nodejs-invoke/server.js'                                   
  ¨                                                                                                                     
}                                                                                                                       
npm ERR] code ELIFECYCLE                                                                                                
npm ERR] errno 1                                                                                                        
npm ERR] [email protected] start: `node server.js`                                                               
npm ERR] Exit status 1                                                                                                  
npm ERR]                                                                                                                
npm ERR] Failed at the [email protected] start script.                                                           
npm ERR] This is probably not a problem with npm. There is likely additional logging output above.                      
                                                                                                                        
npm ERR] A complete log of this run can be found in:                                                                    
npm ERR]     /u/MYUSER/.npm/_logs/2020-11-19T11_02_58_396Z-debug.log                                                   

We are using version 12.18.0 of node.js with CICS 5.5 on z/OS V2R3

Can anyone help me ?
Thanks in advance.
Thank you

@markcocker
Copy link
Member

Can you describe the sequence of events ahead of running npm start, and in particular if you had any errors when running npm install to resolve dependencies.

@namnetes
Copy link
Author

namnetes commented Nov 23, 2020

Hello,

Sorry for this late response.

I cloned the repository on my Windows 10 PC then I launched followed as described the procedure and launched the npm install always on Windows without any error message.

Then, from IDz I transferred the entire project to USS.

Here is what I find in the directories :

../cics-nodejs-invoke/projects/cics-nodejs-invoke/node_modules/form-data/lib>
browser.js
form_data.js
populate.js

In the error message it is the 'form-data' module that is sought.

But in the folder I found form_data.js and renaming the file to form-data.js doesn't change anything.

Best regards

@namnetes
Copy link
Author

Hello,

What's new with my problem ?

Initially I launched the npm install from my Windows workstation in order to recover all the dependencies... since the Z is not connected to the Internet.

In doing so, all the package.json files contained references to the disk locations of my Windows machine. So I launched a FIND AND REPALCE script in order to adjust these files with the project locations under USS.

But it still fails and I don't know why.

Does somebody have an idea ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants