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 for "npm run build" at building module locally for sample app #181

Open
TimoPromann opened this issue Nov 3, 2020 · 2 comments
Open

Comments

@TimoPromann
Copy link

Hey guys,

"rm -rf dist && webpack --config webpack.config.js" is not working. The error states that "rm" is no valid command, but it should be. Full error message is:

22 verbose stack Error: command failed
22 verbose stack at ChildProcess. (C:\Users\ban7427\AppData\Roaming\npm\node_modules\npm\node_modules@npmcli\promise-spawn\index.js:69:27)
22 verbose stack at ChildProcess.emit (node:events:327:20)
22 verbose stack at maybeClose (node:internal/child_process:1048:16)
22 verbose stack at Process.ChildProcess._handle.onexit (node:internal/child_process:288:5)
23 verbose pkgid [email protected]
24 verbose cwd D:\Basisordner\Uni_Doktor\Testing\node_modules\opentok-network-test-js
25 verbose Windows_NT 10.0.17134
26 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Users\ban7427\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "run" "build"
27 verbose node v15.0.1
28 verbose npm v7.0.6
29 error code 1
30 error path D:\Basisordner\Uni_Doktor\Testing\node_modules\opentok-network-test-js
31 error command failed
32 error command C:\WINDOWS\system32\cmd.exe /d /s /c "rm -rf dist && webpack --config webpack.config.js"
33 verbose exit 1

My node version is: 15.0.1
npm: 7.0.6

I cloned the main directory (opentok-network-test-js) and ran "npm install". This took some time and yielded some warnings, but I got no errors. The warnings were:

npm WARN ERESOLVE overriding peer dependency
npm WARN Found: [email protected]
npm WARN node_modules/webpack
npm WARN dev webpack@"^4.12.0" from the root project
npm WARN 3 more (karma-webpack, terser-webpack-plugin, webpack-cli)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer webpack@"^1.0.0 || ^2.0.0 || ^3.0.0" from [email protected]
npm WARN node_modules/webpack-dev-middleware
npm WARN webpack-dev-middleware@"^1.12.0" from [email protected]
npm WARN node_modules/karma-webpack
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '[email protected]',
npm WARN EBADENGINE required: { node: '0.10 || 0.12 || 4 || 5 || 6' },
npm WARN EBADENGINE current: { node: 'v15.0.1', npm: '7.0.6' }
npm WARN EBADENGINE }
npm WARN deprecated @types/[email protected]: Use the global Promise type instead.
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: Use mz or fs-extra^3.0 with Promise Support
npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated [email protected]: request has been deprecated, see request/request#3142
npm WARN deprecated [email protected]: request has been deprecated, see request/request#3142
npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.

Do you have any suggestions, what I am doing wrong?

I also tried to run "npm install opentok-network-test-js", open the opentok-network-test-js directory inside these node_modules and ran "npm install" in there. Similar results.

I am thankful for any help.

@slorello89
Copy link

Hi @TimoPromann - thank's for writing in,

The issue is that rm isn't a valid command in the cmd - and since NPM likes to pipe windows shell commands directly through the windows cmd executable in c:\WINDOWS\System32, when it hits that rm -rf dist command it blows up. We're going to look into resolving this to make it more cross-OS friendly, but for the moment I'd recommend trying to do this in WSL, running this in PowerShell seems to encounter the same issue..

If that's not an option, you could replace this line with:

"build": "del dist /Q && webpack --config webpack.config.js",

that will leverage the cmd del command instead of the rm command

@TimoPromann
Copy link
Author

Hi @slorello89 - thank you for your comment!

The line you suggested worked for building the module in the main directory.

However, when trying to set up the sample app, "npm install", I got another error:

392 verbose stack Error: EPERM: operation not permitted, symlink '..\..' -> 'C:\Users\baj0712\app_dev\opentok-network-test-js\sample\node_modules\opentok-network-test-js'
393 verbose cwd C:\Users\baj0712\app_dev\opentok-network-test-js\sample
394 verbose Windows_NT 10.0.17134
395 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
396 verbose node v15.0.1
397 verbose npm v7.0.3
398 error code EPERM
399 error syscall symlink
400 error path ..\..
401 error dest C:\Users\baj0712\app_dev\opentok-network-test-js\sample\node_modules\opentok-network-test-js
402 error errno -4048
403 error Error: EPERM: operation not permitted, symlink '..\..' -> 'C:\Users\baj0712\app_dev\opentok-network-test-js\sample\node_modules\opentok-network-test-js'
403 error [Error: EPERM: operation not permitted, symlink '..\..' -> 'C:\Users\baj0712\app_dev\opentok-network-test-js\sample\node_modules\opentok-network-test-js'] {​​
403 error errno: -4048,
403 error code: 'EPERM',
403 error syscall: 'symlink',
403 error path: '..\\..',
403 error dest: 'C:\\Users\\baj0712\\app_dev\\opentok-network-test-js\\sample\\node_modules\\opentok-network-test-js'
403 error }​​
404 error The operation was rejected by your operating system.
404 error It's possible that the file was already in use (by a text editor or antivirus),
404 error or that you lack permissions to access it.
404 error
404 error If you believe this might be a permissions issue, please double-check the
404 error permissions of the file and its containing directories, or try running
404 error the command again as root/Administrator.
405 verbose exit -4048

So it seems that within the node modules in the sample app, the folder "opentok-network-test-js" shall be reached. But this seems to fail.

Do you have another suggestion for me how to fix this?

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