'node_modules' is not recognized as an internal or external command, an operational program or batch file.

Asked 2 years ago, Updated 2 years ago, 189 views

yarn run production causes
Gulp seems to be moving halfway...but there is also an error.
Why is this?

C:\Users\User\Documents\Git2>yarn run production
yarn run v1.3.2
(node:12924) [DEP0005]DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods installed.
$ gulp scss&NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/larvel-mix/setup/webpack.config.js
[10:46:00] Using gulpfile~\Documents\Git2\gulpfile.js
[10:46:00] Starting 'scss:pc'...
[10:46:00] Starting 'scss:sp'...
[10:46:01] Finished'scss: pc'after 1.41s
[10:46:01] Finished'scss:sp'after 1.41s
[10:46:01] Starting 'scss'...
[10:46:01] Finished 'scss' after 41μs
where 'node_modules' is an internal command or an external command,
Not recognized as an operational program or batch file.
Note: This command was run via pm module 'win-node-env'
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

●There are two things I have tried to solve.

[ Search by [DEP0005]...

This is not an error.This method of creating buffers is a warning that it is not recommended.
https://stackoverflow.com/questions/52165333/deprecationwarning-buffer-is-deprecated-due-to-security-and-usability-issues

' Search 'node_modules' by internal or external command,..
 
·Is it a problem that I didn't pass through the pass?
Removed \ at the end of the path, restarted the command prompt, and tried again, but it did not change.
http://webdev.jp.net/windows-nodejs-path/

·Since it's win, will it work if the separator of the path is backslashed?
"Scripts" in package.json: {I corrected the following following site, but it turned out to be a different error, so this does not seem to be the cause.
http://iakio.hatenablog.com/entry/2013/12/08/175457

●Each version is as follows.

 C:\Users\User\Documents\Git2>node-v
v10.14.2

C:\Users\User\Documents\Git2>npm-v
6.5.0

C:\Users\User\Documents\Git2>yarn-v
1.3.2

C:\Users\User\Documents\Git2>gulp-v
[10:45:09] CLI version 3.9.1
[10:45:09] Local version 3.9.1

The PC operating system is Win10 Pro.
As for node, I am a complete beginner, so please let me know if there is anything missing.

Thank you for your cooperation.

node.js gulp

2022-09-30 21:35

1 Answers

I'm a questioner.Sorry
In the end, it seems to have been caused by windows, and it seems that it was solved when I escaped the path in package.json with \.
Thank you to the viewers.


2022-09-30 21:35

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.