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 on running command 'npm run build' #25

Open
deepikasharma810 opened this issue Mar 20, 2021 · 15 comments
Open

Error on running command 'npm run build' #25

deepikasharma810 opened this issue Mar 20, 2021 · 15 comments

Comments

@deepikasharma810
Copy link

I am getting ERR_INVALID_AVG_TYPE error on running command 'npm run build'. Could you help me on it?

npm run build

saplearninghub-pdf-downloader@1.0.0 build
webpack -p

Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db
node:internal/fs/utils:637
throw new ERR_INVALID_ARG_TYPE(propName, ['string', 'Buffer', 'URL'], path);
^

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received undefined
at Object.open (node:fs:472:10)
at ReadStream._construct (node:internal/fs/streams:64:17)
at constructNT (node:internal/streams/destroy:288:25)
at processTicksAndRejections (node:internal/process/task_queues:80:21) {
code: 'ERR_INVALID_ARG_TYPE'
}
npm ERR! code 1
npm ERR! path C:\sap
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c webpack -p

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Win 10\AppData\Local\npm-cache_logs\2021-03-20T07_59_00_026Z-debug.log

@jonigigolo
Copy link

Same error here!

@AZn5ReD
Copy link
Owner

AZn5ReD commented Mar 26, 2021

Which version of node do you guys have ?

@deepikasharma810
Copy link
Author

I have the latest version 14.16.0.

@AZn5ReD
Copy link
Owner

AZn5ReD commented Mar 26, 2021

Can you try to run the app using powershell instead of cmd ?

@deepikasharma810
Copy link
Author

I did it with powershell also but the same error occur.

@AZn5ReD
Copy link
Owner

AZn5ReD commented Mar 26, 2021

I just tried the build script on W10, it works fine for me. Could you try cloning and installing the project again ?

@jonigigolo
Copy link

Still with the same problem :(
I downloaded last version of the code, followed the steps but the same error occurs when running npm run build from the command shell inside the directory.

node:internal/fs/utils:637
throw new ERR_INVALID_ARG_TYPE(propName, ['string', 'Buffer', 'URL'], path);
^

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received undefined
at Object.open (node:fs:472:10)
at ReadStream._construct (node:internal/fs/streams:64:17)
at constructNT (node:internal/streams/destroy:288:25)
at processTicksAndRejections (node:internal/process/task_queues:80:21) {
code: 'ERR_INVALID_ARG_TYPE'
}
npm ERR! code 1
npm ERR! path C:\temp
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c webpack -p

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Win10\AppData\Local\npm-cache_logs\2021-03-27T16_47_01_291Z-debug.log

I found that this can be a react-script related error, could that be the issue?

@deepikasharma810
Copy link
Author

Same Error again!!!
But I think there is a problem, while running command 'webpack -p'.
Something is wrong in webpack configfile.

@JacinthaGeorge
Copy link

I initially got the webpack -p error and solved it by installing the specific version of webpack mention in the config.
Now I am stuck with the error -
node:internal/fs/utils:637
throw new ERR_INVALID_ARG_TYPE(propName, ['string', 'Buffer', 'URL'], path);
^

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received undefined

I would want to know the version of Node you are using in your project. Please help.

@JacinthaGeorge
Copy link

JacinthaGeorge commented Apr 1, 2021

I was able to get through webpack error. Now getting "Cant connect"

Starting script...
Going to: https://performancemanager.successfactors.eu/sf/learning?company=learninghub
Entering login: ****
Entering password: ***
Submiting...
Redirected to: https://accounts.sap.com/saml2/idp/usso/Learning_Hub
Can't connect :(
Error: Error during init
at /Users/jessy/Desktop/saplearninghub-pdf-downloader-master/dist/index.js:18:853146
at s (/Users/jessy/Desktop/saplearninghub-pdf-downloader-master/dist/index.js:1:1024976)
at Generator._invoke (/Users/jessy/Desktop/saplearninghub-pdf-downloader-master/dist/index.js:1:1024729)
at Generator.forEach.e. [as next] (/Users/jessy/Desktop/saplearninghub-pdf-downloader-master/dist/index.js:1:1025333)
at t (/Users/jessy/Desktop/saplearninghub-pdf-downloader-master/dist/index.js:1:13899)
at c (/Users/jessy/Desktop/saplearninghub-pdf-downloader-master/dist/index.js:1:14110)
at processTicksAndRejections (internal/process/task_queues.js:93:5)

Looks like the SSO sign in is failing when needs a fix in the code. please help

@AZn5ReD
Copy link
Owner

AZn5ReD commented Apr 2, 2021

For the webpack issue, you can try to set the webpack version to 4.43.0 (instead of ^4.43.0) ?

For the connection issue, someone has solved it : #21 (comment).

@matheusbrasil
Copy link

I've got the same TypeError [ERR_INVALID_ARG_TYPE] but just in my OSx using the NodeJS version V15.9.0. In my W10 with Node version v12.19.0, this error didn't happen.

@DavidRoNa
Copy link

DavidRoNa commented Apr 27, 2022

Hi all, I'm getting the following error when runing "npm run build":
node:internal/crypto/hash:67
this[kHandle] = new _Hash(algorithm, xofLen);
^

Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:67:19)
at Object.createHash (node:crypto:133:10)
at module.exports (C:\saplearninghub\node_modules\webpack\lib\util\createHash.js:135:53)
at NormalModule._initBuildHash (C:\saplearninghub\node_modules\webpack\lib\NormalModule.js:417:16)
at handleParseError (C:\saplearninghub\node_modules\webpack\lib\NormalModule.js:471:10)
at C:\saplearninghub\node_modules\webpack\lib\NormalModule.js:503:5
at C:\saplearninghub\node_modules\webpack\lib\NormalModule.js:358:12
at C:\saplearninghub\node_modules\loader-runner\lib\LoaderRunner.js:373:3
at iterateNormalLoaders (C:\saplearninghub\node_modules\loader-runner\lib\LoaderRunner.js:214:10)
at iterateNormalLoaders (C:\saplearninghub\node_modules\loader-runner\lib\LoaderRunner.js:221:10)
at C:\saplearninghub\node_modules\loader-runner\lib\LoaderRunner.js:236:3
at context.callback (C:\saplearninghub\node_modules\loader-runner\lib\LoaderRunner.js:111:13)
at C:\saplearninghub\node_modules\babel-loader\lib\index.js:59:71 {
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v18.0.0

Could someone help me please?
Thanks in advance.

@AZn5ReD
Copy link
Owner

AZn5ReD commented Apr 28, 2022

Looks like the version of NodeJS you are using is too high : https://stackoverflow.com/questions/69692842/error-message-error0308010cdigital-envelope-routinesunsupported
Please downgrade it or use nvm.

@DavidRoNa
Copy link

Looks like the version of NodeJS you are using is too high : https://stackoverflow.com/questions/69692842/error-message-error0308010cdigital-envelope-routinesunsupported Please downgrade it or use nvm.

It worked!
Thank you so much!!!

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

6 participants